cvs: peardoc /en/package/networking/net-ipv4 atoh.xml calculate.xml htoa.xml ip2double.xml ipinnetwork.xml parseaddress.xml validateip.xml
validatenetmask.xml
| From: | Florian Anderiasch | Date: | Tue, 29 Nov 2005 19:34:19 +0000 |
| Subject: | cvs: peardoc /en/package/networking/net-ipv4 atoh.xml calculate.xml htoa.xml ip2double.xml ipinnetwork.xml parseaddress.xml validateip.xml validatenetmask.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7236@lists.php.net to get a copy of this message | ||
fa Tue Nov 29 14:34:19 2005 EDT
Modified files:
/peardoc/en/package/networking/net-ipv4 atoh.xml calculate.xml
htoa.xml ip2double.xml
ipinnetwork.xml
parseaddress.xml
validateip.xml
validatenetmask.xml
Log:
fixed some errors, added some info
http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/atoh.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/atoh.xml diff -u peardoc/en/package/networking/net-ipv4/atoh.xml:1.2 peardoc/en/package/networking/net-ipv4/atoh.xml:1.3 --- peardoc/en/package/networking/net-ipv4/atoh.xml:1.2 Wed Feb 11 05:43:51 2004 +++ peardoc/en/package/networking/net-ipv4/atoh.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.atoh"> - <refnamediv> - <refname>Net_IPv4::atoh()</refname> - <refpurpose>Converts a dot-quad formatted IP address into a hexadecimal string</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>string <function>atoh</function></funcdef> - <paramdef>string <parameter>$addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.atoh.desc"> - &title.desc; - <para> - Converts dot-quad formatted IP address into a hexadecimal string - for example "192.168.1.0" to "c0a80100". - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.atoh.note"> - &title.note; - ¬e.canstatic; - </refsect1> - </refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.atoh"> + <refnamediv> + <refname>Net_IPv4::atoh()</refname> + <refpurpose>Converts a dot-quad formatted IP address into a hexadecimal string</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>mixed <function>atoh</function></funcdef> + <paramdef>string <parameter>$addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.atoh.desc"> + &title.desc; + <para> + Converts a dot-quad formatted IP address into a hexadecimal string - for example "192.168.1.0" to "c0a80100". Returns &false; if the string given is no valid IP adress. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.atoh.note"> + &title.note; + ¬e.canstatic; + </refsect1> + </refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/calculate.xml?r1=1.3&r2=1.4&ty=u Index: peardoc/en/package/networking/net-ipv4/calculate.xml diff -u peardoc/en/package/networking/net-ipv4/calculate.xml:1.3 peardoc/en/package/networking/net-ipv4/calculate.xml:1.4 --- peardoc/en/package/networking/net-ipv4/calculate.xml:1.3 Wed Feb 11 06:04:48 2004 +++ peardoc/en/package/networking/net-ipv4/calculate.xml Tue Nov 29 14:34:17 2005 @@ -1,99 +1,99 @@ -<!-- $Revision: 1.3 $ --> -<refentry id="package.networking.net-ipv4.calculate"> - <refnamediv> - <refname>Net_IPv4::calculate()</refname> - <refpurpose>Calculates network information based on an IP address and netmask.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>mixed <function>calculate</function></funcdef> - <paramdef></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.calculate.desc"> - &title.desc; - <para> - Fully populates the object properties based on the IP address and - netmask/bitmask properties. Once these two fields are populated, - calculate() will perform calculations to determine the network and - broadcast address of the network. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.calculate.example"> - &title.example; - <para> - <example> - <title>Calculating broadcast and network address</title> - <programlisting role="php"> -<![CDATA[ -<?php - -require('Net/IPv4.php'); - -// create IPv4 object -$ip_calc = new Net_IPv4(); - -// set variables -$ip_calc->ip = "a192.168.1.10"; -$ip_calc->netmask = "255.255.255.0"; - -/* alternative method with numerical values: -$ip_calc->long = 3232235786; -$ip_calc->bitmask = 24; -*/ - -// calculate -$error = $ip_calc->calculate(); -if (!is_object($error)) -{ - // if returned true, output - echo "Your network address: ".$ip_calc->network."<br />"; - echo "Your broadcast address: ".$ip_calc->broadcast."<br />"; -} -else -{ - // otherwise handle error - echo "An error occured: ".$error->getMessage(); -} - -?> -]]> - </programlisting> - </example> - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.calculate.return"> - &title.returns; - <para> - <parameter>boolean</parameter> - &return.success-pearerror; - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.calculate.note"> - &title.note; - ¬e.notstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.4 $ --> +<refentry id="package.networking.net-ipv4.calculate"> + <refnamediv> + <refname>Net_IPv4::calculate()</refname> + <refpurpose>Calculates network information based on an IP address and netmask.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>mixed <function>calculate</function></funcdef> + <paramdef></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.calculate.desc"> + &title.desc; + <para> + Fully populates the object properties based on the IP address and + netmask/bitmask properties. Once these two fields are populated, + calculate() will perform calculations to determine the network and + broadcast address of the network. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.calculate.example"> + &title.example; + <para> + <example> + <title>Calculating broadcast and network address</title> + <programlisting role="php"> +<![CDATA[ +<?php + +require 'Net/IPv4.php'; + +// create IPv4 object +$ip_calc = new Net_IPv4(); + +// set variables +$ip_calc->ip = "192.168.1.10"; +$ip_calc->netmask = "255.255.255.0"; + +/* alternative method with numerical values: +$ip_calc->long = 3232235786; +$ip_calc->bitmask = 24; +*/ + +// calculate +$error = $ip_calc->calculate(); +if (!is_object($error)) +{ + // if returned true, output + echo "Your network address: ".$ip_calc->network."<br />"; + echo "Your broadcast address: ".$ip_calc->broadcast."<br />"; +} +else +{ + // otherwise handle error + echo "An error occured: ".$error->getMessage(); +} + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.calculate.return"> + &title.returns; + <para> + <parameter>boolean</parameter> - &return.success-pearerror; + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.calculate.note"> + &title.note; + ¬e.notstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/htoa.xml?r1=1.3&r2=1.4&ty=u Index: peardoc/en/package/networking/net-ipv4/htoa.xml diff -u peardoc/en/package/networking/net-ipv4/htoa.xml:1.3 peardoc/en/package/networking/net-ipv4/htoa.xml:1.4 --- peardoc/en/package/networking/net-ipv4/htoa.xml:1.3 Fri Sep 9 15:54:01 2005 +++ peardoc/en/package/networking/net-ipv4/htoa.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.3 $ --> -<refentry id="package.networking.net-ipv4.htoa"> - <refnamediv> - <refname>Net_IPv4::htoa()</refname> - <refpurpose>Converts a hexadecimal string into a dot-quad formatted IP address</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>string <function>htoa</function></funcdef> - <paramdef>string <parameter>$addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.htoa.desc"> - &title.desc; - <para> - Converts hexadecimal string to a dot-quad formatted IP address - for example "c0a80100" to "192.168.1.0". - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.htoa.note"> - &title.note; - ¬e.canstatic; - </refsect1> - </refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.4 $ --> +<refentry id="package.networking.net-ipv4.htoa"> + <refnamediv> + <refname>Net_IPv4::htoa()</refname> + <refpurpose>Converts a hexadecimal string into a dot-quad formatted IP address</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>mixed <function>htoa</function></funcdef> + <paramdef>string <parameter>$addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.htoa.desc"> + &title.desc; + <para> + Converts hexadecimal string to a dot-quad formatted IP address - for example "c0a80100" to "192.168.1.0". Returns &false; if the hexadecimal string is no valid IP adress. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.htoa.note"> + &title.note; + ¬e.canstatic; + </refsect1> + </refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/ip2double.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/ip2double.xml diff -u peardoc/en/package/networking/net-ipv4/ip2double.xml:1.2 peardoc/en/package/networking/net-ipv4/ip2double.xml:1.3 --- peardoc/en/package/networking/net-ipv4/ip2double.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/ip2double.xml Tue Nov 29 14:34:17 2005 @@ -1,49 +1,49 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.ip2double"> - <refnamediv> - <refname>Net_IPv4::ip2double()</refname> - <refpurpose>Converts an IP address to a PHP double.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>string <function>ip2double</function></funcdef> - <paramdef>string <parameter>$ip_addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.ip2double.desc"> - &title.desc; - <para> - Converts an IP address to a PHP double. A double is, - in contrast to ip2long's integer, not signed and may be - more comfortable when presented to the user. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.ip2double.note"> - &title.note; - ¬e.canstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.ip2double"> + <refnamediv> + <refname>Net_IPv4::ip2double()</refname> + <refpurpose>Converts an IP address to a PHP double.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>float <function>ip2double</function></funcdef> + <paramdef>string <parameter>$ip_addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.ip2double.desc"> + &title.desc; + <para> + Converts an IP address to a PHP double - for example "192.168.1.0" to "3232235776". A double is, + in contrast to ip2long's integer, not signed and may be + more comfortable when presented to the user. It can still be reconverted with PHP's <function>long2ip</function>. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.ip2double.note"> + &title.note; + ¬e.canstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/ipinnetwork.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/networking/net-ipv4/ipinnetwork.xml diff -u peardoc/en/package/networking/net-ipv4/ipinnetwork.xml:1.1 peardoc/en/package/networking/net-ipv4/ipinnetwork.xml:1.2 --- peardoc/en/package/networking/net-ipv4/ipinnetwork.xml:1.1 Wed Jul 21 14:26:23 2004 +++ peardoc/en/package/networking/net-ipv4/ipinnetwork.xml Tue Nov 29 14:34:17 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.networking.net-ipv4.ipinnetwork"> <refnamediv> <refname>Net_IPv4::ipInNetwork()</refname> @@ -26,11 +26,34 @@ &title.desc; <para> Determines whether or not the supplied IP address is within the - supplied - network. + supplied network. </para> </refsect1> - + + <refsect1 id="package.networking.net-ipv4.ipinnetwork.example"> + &title.example; + <para> + <example> + <title>Checking if a IP adress is contained in a network</title> + <programlisting role="php"> +<![CDATA[ +<?php + +require 'Net/IPv4.php'; + +$ip = '10.11.12.13'; +$net1 = '10.0.0.1/8'; +$net2 = '127.0.0.1/8'; + +echo Net_IPv4::ipInNetwork($ip, $net1) // bool(true) +echo Net_IPv4::ipInNetwork($ip, $net2) // bool(false) +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.ipinnetwork.note"> &title.note; ¬e.canstatic; http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/parseaddress.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/parseaddress.xml diff -u peardoc/en/package/networking/net-ipv4/parseaddress.xml:1.2 peardoc/en/package/networking/net-ipv4/parseaddress.xml:1.3 --- peardoc/en/package/networking/net-ipv4/parseaddress.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/parseaddress.xml Tue Nov 29 14:34:17 2005 @@ -1,80 +1,80 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.parseaddress"> - <refnamediv> - <refname>Net_IPv4::parseAddress()</refname> - <refpurpose>Parse a CIDR address (address/netmask combination).</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>bool <function>parseAddress</function></funcdef> - <paramdef>string <parameter>$address</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.parseaddress.desc"> - &title.desc; - <para> - Parses a Classless Inter-Domain Routing address (e.g. 192.168.1.0/24) and stores - information in the object variables network, ip, netmask, broadcast, long and bitmask. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.parseaddress.example"> - &title.example; - <para> - <example> - <title>How to get netmask and broadcast from CIDR address</title> - <programlisting role="php"> -<![CDATA[ -<?php - -require('Net/IPv4.php'); - -$cidr = '192.168.0.50/16'; -$net = Net_IPv4::parseAddress($cidr); -echo $net->network; // 192.168.0.0 -echo $net->ip; // 192.168.0.50 -echo $net->broadcast; // 192.168.255.255 -echo $net->bitmask; // 16 -echo $net->long; // 3232235520 (long/double version of 192.168.0.50) -echo $net->netmask; // 255.255.0.0 - -?> -]]> - </programlisting> - </example> - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.parseaddress.return"> - &title.returns; - <para> - <parameter>boolean</parameter> - &return.success-pearerror; - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.parseaddress.note"> - &title.note; - ¬e.notstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.parseaddress"> + <refnamediv> + <refname>Net_IPv4::parseAddress()</refname> + <refpurpose>Parse a CIDR address (address/netmask combination).</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once('Net/IPv4.php'); + </funcsynopsisinfo> + <funcprototype> + <funcdef>bool <function>parseAddress</function></funcdef> + <paramdef>string <parameter>$address</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.parseaddress.desc"> + &title.desc; + <para> + Parses a Classless Inter-Domain Routing address (e.g. 192.168.1.0/24) and stores + information in the object variables network, ip, netmask, broadcast, long and bitmask. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.parseaddress.example"> + &title.example; + <para> + <example> + <title>How to get netmask and broadcast from CIDR address</title> + <programlisting role="php"> +<![CDATA[ +<?php + +require('Net/IPv4.php'); + +$cidr = '192.168.0.50/16'; +$net = Net_IPv4::parseAddress($cidr); +echo $net->network; // 192.168.0.0 +echo $net->ip; // 192.168.0.50 +echo $net->broadcast; // 192.168.255.255 +echo $net->bitmask; // 16 +echo $net->long; // 3232235520 (long/double version of 192.168.0.50) +echo $net->netmask; // 255.255.0.0 + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.parseaddress.return"> + &title.returns; + <para> + <parameter>boolean</parameter> - &return.success-pearerror; + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.parseaddress.note"> + &title.note; + ¬e.notstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/validateip.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/validateip.xml diff -u peardoc/en/package/networking/net-ipv4/validateip.xml:1.2 peardoc/en/package/networking/net-ipv4/validateip.xml:1.3 --- peardoc/en/package/networking/net-ipv4/validateip.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/validateip.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.validateip"> - <refnamediv> - <refname>Net_IPv4::validateIP()</refname> - <refpurpose>Validate the syntax of the given IP adress.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>bool <function>validateIP</function></funcdef> - <paramdef>string <parameter>$ip_addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.validateip.desc"> - &title.desc; - <para> - Validates the syntax of an IP address. Returns true if address is valid, false if not. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.validateip.note"> - &title.note; - ¬e.canstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.validateip"> + <refnamediv> + <refname>Net_IPv4::validateIP()</refname> + <refpurpose>Validate the syntax of the given IP adress.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>bool <function>validateIP</function></funcdef> + <paramdef>string <parameter>$ip_addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.validateip.desc"> + &title.desc; + <para> + Validates the syntax of an IP address in dot-quad format. Returns true if address is valid, false if not. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.validateip.note"> + &title.note; + ¬e.canstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/validatenetmask.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/validatenetmask.xml diff -u peardoc/en/package/networking/net-ipv4/validatenetmask.xml:1.2 peardoc/en/package/networking/net-ipv4/validatenetmask.xml:1.3 --- peardoc/en/package/networking/net-ipv4/validatenetmask.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/validatenetmask.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.validatenetmask"> - <refnamediv> - <refname>Net_IPv4::validateNetmask()</refname> - <refpurpose>Validate the syntax of the given netmask.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>bool <function>validateNetmask</function></funcdef> - <paramdef>string <parameter>$netmask</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.validatenetmask.desc"> - &title.desc; - <para> - Validates the syntax of a dot-quad formatted netmask. Returns true if netmask is valid, false if not. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.validatenetmask.note"> - &title.note; - ¬e.canstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.validatenetmask"> + <refnamediv> + <refname>Net_IPv4::validateNetmask()</refname> + <refpurpose>Validate the syntax of the given netmask.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>bool <function>validateNetmask</function></funcdef> + <paramdef>string <parameter>$netmask</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.validatenetmask.desc"> + &title.desc; + <para> + Validates the syntax of a dot-quad formatted netmask. Returns true if netmask is valid, false if not. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.validatenetmask.note"> + &title.note; + ¬e.canstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +-->
http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/atoh.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/atoh.xml diff -u peardoc/en/package/networking/net-ipv4/atoh.xml:1.2 peardoc/en/package/networking/net-ipv4/atoh.xml:1.3 --- peardoc/en/package/networking/net-ipv4/atoh.xml:1.2 Wed Feb 11 05:43:51 2004 +++ peardoc/en/package/networking/net-ipv4/atoh.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.atoh"> - <refnamediv> - <refname>Net_IPv4::atoh()</refname> - <refpurpose>Converts a dot-quad formatted IP address into a hexadecimal string</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>string <function>atoh</function></funcdef> - <paramdef>string <parameter>$addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.atoh.desc"> - &title.desc; - <para> - Converts dot-quad formatted IP address into a hexadecimal string - for example "192.168.1.0" to "c0a80100". - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.atoh.note"> - &title.note; - ¬e.canstatic; - </refsect1> - </refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.atoh"> + <refnamediv> + <refname>Net_IPv4::atoh()</refname> + <refpurpose>Converts a dot-quad formatted IP address into a hexadecimal string</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>mixed <function>atoh</function></funcdef> + <paramdef>string <parameter>$addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.atoh.desc"> + &title.desc; + <para> + Converts a dot-quad formatted IP address into a hexadecimal string - for example "192.168.1.0" to "c0a80100". Returns &false; if the string given is no valid IP adress. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.atoh.note"> + &title.note; + ¬e.canstatic; + </refsect1> + </refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/calculate.xml?r1=1.3&r2=1.4&ty=u Index: peardoc/en/package/networking/net-ipv4/calculate.xml diff -u peardoc/en/package/networking/net-ipv4/calculate.xml:1.3 peardoc/en/package/networking/net-ipv4/calculate.xml:1.4 --- peardoc/en/package/networking/net-ipv4/calculate.xml:1.3 Wed Feb 11 06:04:48 2004 +++ peardoc/en/package/networking/net-ipv4/calculate.xml Tue Nov 29 14:34:17 2005 @@ -1,99 +1,99 @@ -<!-- $Revision: 1.3 $ --> -<refentry id="package.networking.net-ipv4.calculate"> - <refnamediv> - <refname>Net_IPv4::calculate()</refname> - <refpurpose>Calculates network information based on an IP address and netmask.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>mixed <function>calculate</function></funcdef> - <paramdef></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.calculate.desc"> - &title.desc; - <para> - Fully populates the object properties based on the IP address and - netmask/bitmask properties. Once these two fields are populated, - calculate() will perform calculations to determine the network and - broadcast address of the network. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.calculate.example"> - &title.example; - <para> - <example> - <title>Calculating broadcast and network address</title> - <programlisting role="php"> -<![CDATA[ -<?php - -require('Net/IPv4.php'); - -// create IPv4 object -$ip_calc = new Net_IPv4(); - -// set variables -$ip_calc->ip = "a192.168.1.10"; -$ip_calc->netmask = "255.255.255.0"; - -/* alternative method with numerical values: -$ip_calc->long = 3232235786; -$ip_calc->bitmask = 24; -*/ - -// calculate -$error = $ip_calc->calculate(); -if (!is_object($error)) -{ - // if returned true, output - echo "Your network address: ".$ip_calc->network."<br />"; - echo "Your broadcast address: ".$ip_calc->broadcast."<br />"; -} -else -{ - // otherwise handle error - echo "An error occured: ".$error->getMessage(); -} - -?> -]]> - </programlisting> - </example> - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.calculate.return"> - &title.returns; - <para> - <parameter>boolean</parameter> - &return.success-pearerror; - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.calculate.note"> - &title.note; - ¬e.notstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.4 $ --> +<refentry id="package.networking.net-ipv4.calculate"> + <refnamediv> + <refname>Net_IPv4::calculate()</refname> + <refpurpose>Calculates network information based on an IP address and netmask.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>mixed <function>calculate</function></funcdef> + <paramdef></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.calculate.desc"> + &title.desc; + <para> + Fully populates the object properties based on the IP address and + netmask/bitmask properties. Once these two fields are populated, + calculate() will perform calculations to determine the network and + broadcast address of the network. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.calculate.example"> + &title.example; + <para> + <example> + <title>Calculating broadcast and network address</title> + <programlisting role="php"> +<![CDATA[ +<?php + +require 'Net/IPv4.php'; + +// create IPv4 object +$ip_calc = new Net_IPv4(); + +// set variables +$ip_calc->ip = "192.168.1.10"; +$ip_calc->netmask = "255.255.255.0"; + +/* alternative method with numerical values: +$ip_calc->long = 3232235786; +$ip_calc->bitmask = 24; +*/ + +// calculate +$error = $ip_calc->calculate(); +if (!is_object($error)) +{ + // if returned true, output + echo "Your network address: ".$ip_calc->network."<br />"; + echo "Your broadcast address: ".$ip_calc->broadcast."<br />"; +} +else +{ + // otherwise handle error + echo "An error occured: ".$error->getMessage(); +} + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.calculate.return"> + &title.returns; + <para> + <parameter>boolean</parameter> - &return.success-pearerror; + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.calculate.note"> + &title.note; + ¬e.notstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/htoa.xml?r1=1.3&r2=1.4&ty=u Index: peardoc/en/package/networking/net-ipv4/htoa.xml diff -u peardoc/en/package/networking/net-ipv4/htoa.xml:1.3 peardoc/en/package/networking/net-ipv4/htoa.xml:1.4 --- peardoc/en/package/networking/net-ipv4/htoa.xml:1.3 Fri Sep 9 15:54:01 2005 +++ peardoc/en/package/networking/net-ipv4/htoa.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.3 $ --> -<refentry id="package.networking.net-ipv4.htoa"> - <refnamediv> - <refname>Net_IPv4::htoa()</refname> - <refpurpose>Converts a hexadecimal string into a dot-quad formatted IP address</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>string <function>htoa</function></funcdef> - <paramdef>string <parameter>$addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.htoa.desc"> - &title.desc; - <para> - Converts hexadecimal string to a dot-quad formatted IP address - for example "c0a80100" to "192.168.1.0". - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.htoa.note"> - &title.note; - ¬e.canstatic; - </refsect1> - </refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.4 $ --> +<refentry id="package.networking.net-ipv4.htoa"> + <refnamediv> + <refname>Net_IPv4::htoa()</refname> + <refpurpose>Converts a hexadecimal string into a dot-quad formatted IP address</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>mixed <function>htoa</function></funcdef> + <paramdef>string <parameter>$addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.htoa.desc"> + &title.desc; + <para> + Converts hexadecimal string to a dot-quad formatted IP address - for example "c0a80100" to "192.168.1.0". Returns &false; if the hexadecimal string is no valid IP adress. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.htoa.note"> + &title.note; + ¬e.canstatic; + </refsect1> + </refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/ip2double.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/ip2double.xml diff -u peardoc/en/package/networking/net-ipv4/ip2double.xml:1.2 peardoc/en/package/networking/net-ipv4/ip2double.xml:1.3 --- peardoc/en/package/networking/net-ipv4/ip2double.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/ip2double.xml Tue Nov 29 14:34:17 2005 @@ -1,49 +1,49 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.ip2double"> - <refnamediv> - <refname>Net_IPv4::ip2double()</refname> - <refpurpose>Converts an IP address to a PHP double.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>string <function>ip2double</function></funcdef> - <paramdef>string <parameter>$ip_addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.ip2double.desc"> - &title.desc; - <para> - Converts an IP address to a PHP double. A double is, - in contrast to ip2long's integer, not signed and may be - more comfortable when presented to the user. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.ip2double.note"> - &title.note; - ¬e.canstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.ip2double"> + <refnamediv> + <refname>Net_IPv4::ip2double()</refname> + <refpurpose>Converts an IP address to a PHP double.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>float <function>ip2double</function></funcdef> + <paramdef>string <parameter>$ip_addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.ip2double.desc"> + &title.desc; + <para> + Converts an IP address to a PHP double - for example "192.168.1.0" to "3232235776". A double is, + in contrast to ip2long's integer, not signed and may be + more comfortable when presented to the user. It can still be reconverted with PHP's <function>long2ip</function>. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.ip2double.note"> + &title.note; + ¬e.canstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/ipinnetwork.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/networking/net-ipv4/ipinnetwork.xml diff -u peardoc/en/package/networking/net-ipv4/ipinnetwork.xml:1.1 peardoc/en/package/networking/net-ipv4/ipinnetwork.xml:1.2 --- peardoc/en/package/networking/net-ipv4/ipinnetwork.xml:1.1 Wed Jul 21 14:26:23 2004 +++ peardoc/en/package/networking/net-ipv4/ipinnetwork.xml Tue Nov 29 14:34:17 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.networking.net-ipv4.ipinnetwork"> <refnamediv> <refname>Net_IPv4::ipInNetwork()</refname> @@ -26,11 +26,34 @@ &title.desc; <para> Determines whether or not the supplied IP address is within the - supplied - network. + supplied network. </para> </refsect1> - + + <refsect1 id="package.networking.net-ipv4.ipinnetwork.example"> + &title.example; + <para> + <example> + <title>Checking if a IP adress is contained in a network</title> + <programlisting role="php"> +<![CDATA[ +<?php + +require 'Net/IPv4.php'; + +$ip = '10.11.12.13'; +$net1 = '10.0.0.1/8'; +$net2 = '127.0.0.1/8'; + +echo Net_IPv4::ipInNetwork($ip, $net1) // bool(true) +echo Net_IPv4::ipInNetwork($ip, $net2) // bool(false) +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.ipinnetwork.note"> &title.note; ¬e.canstatic; http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/parseaddress.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/parseaddress.xml diff -u peardoc/en/package/networking/net-ipv4/parseaddress.xml:1.2 peardoc/en/package/networking/net-ipv4/parseaddress.xml:1.3 --- peardoc/en/package/networking/net-ipv4/parseaddress.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/parseaddress.xml Tue Nov 29 14:34:17 2005 @@ -1,80 +1,80 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.parseaddress"> - <refnamediv> - <refname>Net_IPv4::parseAddress()</refname> - <refpurpose>Parse a CIDR address (address/netmask combination).</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>bool <function>parseAddress</function></funcdef> - <paramdef>string <parameter>$address</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.parseaddress.desc"> - &title.desc; - <para> - Parses a Classless Inter-Domain Routing address (e.g. 192.168.1.0/24) and stores - information in the object variables network, ip, netmask, broadcast, long and bitmask. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.parseaddress.example"> - &title.example; - <para> - <example> - <title>How to get netmask and broadcast from CIDR address</title> - <programlisting role="php"> -<![CDATA[ -<?php - -require('Net/IPv4.php'); - -$cidr = '192.168.0.50/16'; -$net = Net_IPv4::parseAddress($cidr); -echo $net->network; // 192.168.0.0 -echo $net->ip; // 192.168.0.50 -echo $net->broadcast; // 192.168.255.255 -echo $net->bitmask; // 16 -echo $net->long; // 3232235520 (long/double version of 192.168.0.50) -echo $net->netmask; // 255.255.0.0 - -?> -]]> - </programlisting> - </example> - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.parseaddress.return"> - &title.returns; - <para> - <parameter>boolean</parameter> - &return.success-pearerror; - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.parseaddress.note"> - &title.note; - ¬e.notstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.parseaddress"> + <refnamediv> + <refname>Net_IPv4::parseAddress()</refname> + <refpurpose>Parse a CIDR address (address/netmask combination).</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once('Net/IPv4.php'); + </funcsynopsisinfo> + <funcprototype> + <funcdef>bool <function>parseAddress</function></funcdef> + <paramdef>string <parameter>$address</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.parseaddress.desc"> + &title.desc; + <para> + Parses a Classless Inter-Domain Routing address (e.g. 192.168.1.0/24) and stores + information in the object variables network, ip, netmask, broadcast, long and bitmask. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.parseaddress.example"> + &title.example; + <para> + <example> + <title>How to get netmask and broadcast from CIDR address</title> + <programlisting role="php"> +<![CDATA[ +<?php + +require('Net/IPv4.php'); + +$cidr = '192.168.0.50/16'; +$net = Net_IPv4::parseAddress($cidr); +echo $net->network; // 192.168.0.0 +echo $net->ip; // 192.168.0.50 +echo $net->broadcast; // 192.168.255.255 +echo $net->bitmask; // 16 +echo $net->long; // 3232235520 (long/double version of 192.168.0.50) +echo $net->netmask; // 255.255.0.0 + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.parseaddress.return"> + &title.returns; + <para> + <parameter>boolean</parameter> - &return.success-pearerror; + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.parseaddress.note"> + &title.note; + ¬e.notstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/validateip.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/validateip.xml diff -u peardoc/en/package/networking/net-ipv4/validateip.xml:1.2 peardoc/en/package/networking/net-ipv4/validateip.xml:1.3 --- peardoc/en/package/networking/net-ipv4/validateip.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/validateip.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.validateip"> - <refnamediv> - <refname>Net_IPv4::validateIP()</refname> - <refpurpose>Validate the syntax of the given IP adress.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>bool <function>validateIP</function></funcdef> - <paramdef>string <parameter>$ip_addr</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.validateip.desc"> - &title.desc; - <para> - Validates the syntax of an IP address. Returns true if address is valid, false if not. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.validateip.note"> - &title.note; - ¬e.canstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.validateip"> + <refnamediv> + <refname>Net_IPv4::validateIP()</refname> + <refpurpose>Validate the syntax of the given IP adress.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>bool <function>validateIP</function></funcdef> + <paramdef>string <parameter>$ip_addr</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.validateip.desc"> + &title.desc; + <para> + Validates the syntax of an IP address in dot-quad format. Returns true if address is valid, false if not. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.validateip.note"> + &title.note; + ¬e.canstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-ipv4/validatenetmask.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-ipv4/validatenetmask.xml diff -u peardoc/en/package/networking/net-ipv4/validatenetmask.xml:1.2 peardoc/en/package/networking/net-ipv4/validatenetmask.xml:1.3 --- peardoc/en/package/networking/net-ipv4/validatenetmask.xml:1.2 Wed Feb 11 05:44:39 2004 +++ peardoc/en/package/networking/net-ipv4/validatenetmask.xml Tue Nov 29 14:34:17 2005 @@ -1,47 +1,47 @@ -<!-- $Revision: 1.2 $ --> -<refentry id="package.networking.net-ipv4.validatenetmask"> - <refnamediv> - <refname>Net_IPv4::validateNetmask()</refname> - <refpurpose>Validate the syntax of the given netmask.</refpurpose> - </refnamediv> - <refsynopsisdiv> - <funcsynopsis> - <funcsynopsisinfo> - require_once('Net/IPv4.php'); - </funcsynopsisinfo> - <funcprototype> - <funcdef>bool <function>validateNetmask</function></funcdef> - <paramdef>string <parameter>$netmask</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - <refsect1 id="package.networking.net-ipv4.validatenetmask.desc"> - &title.desc; - <para> - Validates the syntax of a dot-quad formatted netmask. Returns true if netmask is valid, false if not. - </para> - </refsect1> - <refsect1 id="package.networking.net-ipv4.validatenetmask.note"> - &title.note; - ¬e.canstatic; - </refsect1> -</refentry> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<refentry id="package.networking.net-ipv4.validatenetmask"> + <refnamediv> + <refname>Net_IPv4::validateNetmask()</refname> + <refpurpose>Validate the syntax of the given netmask.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <funcsynopsis> + <funcsynopsisinfo> + require_once 'Net/IPv4.php'; + </funcsynopsisinfo> + <funcprototype> + <funcdef>bool <function>validateNetmask</function></funcdef> + <paramdef>string <parameter>$netmask</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + <refsect1 id="package.networking.net-ipv4.validatenetmask.desc"> + &title.desc; + <para> + Validates the syntax of a dot-quad formatted netmask. Returns true if netmask is valid, false if not. + </para> + </refsect1> + <refsect1 id="package.networking.net-ipv4.validatenetmask.note"> + &title.note; + ¬e.canstatic; + </refsect1> +</refentry> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +-->