home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / SockAddr.pm < prev    next >
Encoding:
Perl POD Document  |  2004-09-23  |  3.7 KB  |  195 lines

  1. # /*
  2. #  * *********** WARNING **************
  3. #  * This file generated by ModPerl::WrapXS/0.01
  4. #  * Any changes made here will be lost
  5. #  * ***********************************
  6. #  * 01: lib/ModPerl/Code.pm:701
  7. #  * 02: O:\147xampp\sources\mod_perl-1.99_16\blib\lib/ModPerl/WrapXS.pm:584
  8. #  * 03: O:\147xampp\sources\mod_perl-1.99_16\blib\lib/ModPerl/WrapXS.pm:1100
  9. #  * 04: Makefile.PL:335
  10. #  * 05: Makefile.PL:283
  11. #  * 06: Makefile.PL:51
  12. #  */
  13.  
  14.  
  15. package APR::SockAddr;
  16.  
  17. use strict;
  18. use warnings FATAL => 'all';
  19.  
  20.  
  21. use APR ();
  22. use APR::XSLoader ();
  23. our $VERSION = '0.01';
  24. APR::XSLoader::load __PACKAGE__;
  25.  
  26.  
  27.  
  28. 1;
  29. __END__
  30.  
  31. =head1 NAME
  32.  
  33. APR::SockAddr - Perl API for APR socket address structure
  34.  
  35.  
  36.  
  37.  
  38. =head1 Synopsis
  39.  
  40.   use APR::SockAddr ();
  41.   
  42.   my $ip = $sock_addr->ip_get;
  43.   my $port = $sock_addr->port;
  44.  
  45.  
  46.  
  47.  
  48.  
  49. =head1 Description
  50.  
  51. C<APR::SockAddr> provides an access to a socket address structure
  52. fields.
  53.  
  54. Normally you'd get a socket address object, by calling:
  55.  
  56.   use Apache::Connection ();
  57.   my $remote_sock_addr = $c->remote_addr;
  58.   my $local_sock_addr  = $c->remote_local;
  59.  
  60.  
  61.  
  62.  
  63. =head1 API
  64.  
  65. C<APR::SockAddr> provides the following functions and/or methods:
  66.  
  67.  
  68.  
  69.  
  70.  
  71. =head2 C<ip_get>
  72.  
  73. Get the IP address of the socket
  74.  
  75.   $ip = $sock_addr->ip_get();
  76.  
  77. =over 4
  78.  
  79. =item obj: C<$sock_addr>
  80. ( C<L<APR::SockAddr object|docs::2.0::api::APR::SockAddr>> )
  81.  
  82. =item ret: C<$ip> ( string )
  83.  
  84. =item since: 1.99_10
  85.  
  86. =back
  87.  
  88. If you are familiar with how perl's C<Socket> works:
  89.  
  90.   use Socket 'sockaddr_in';
  91.   my ($serverport, $serverip) = sockaddr_in(getpeername($local_sock));
  92.   my ($remoteport, $remoteip) = sockaddr_in(getpeername($remote_sock));
  93.  
  94. in apr-speak that'd be written as:
  95.  
  96.   use APR::SockAddr ();
  97.   use Apache::Connection ();
  98.   my $serverport = $c->local_addr->port;
  99.   my $serverip   = $c->local_addr->ip_get;
  100.   my $remoteport = $c->remote_addr->port;
  101.   my $remoteip   = $c->remote_addr->ip_get;
  102.  
  103.  
  104. =head2 C<port>
  105.  
  106. Get the IP address of the socket
  107.  
  108.   $port = $sock_addr->port();
  109.  
  110. =over 4
  111.  
  112. =item obj: C<$sock_addr>
  113. ( C<L<APR::SockAddr object|docs::2.0::api::APR::SockAddr>> )
  114.  
  115. =item ret: C<$port> ( integer )
  116.  
  117. =item since: 1.99_10
  118.  
  119. =back
  120.  
  121. Example: see C<L<ip_get()|/C_ip_get_>>
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. =head1 Unsupported API
  129.  
  130. C<APR::SockAddr> also provides auto-generated Perl interface for a few
  131. other methods which aren't tested at the moment and therefore their
  132. API is a subject to change. These methods will be finalized later as a
  133. need arises. If you want to rely on any of the following methods
  134. please contact the L<the mod_perl development mailing
  135. list|maillist::dev> so we can help each other take the steps necessary
  136. to shift the method to an officially supported API.
  137.  
  138.  
  139. =head2 C<equal>
  140.  
  141. META: Autogenerated - needs to be reviewed/completed
  142.  
  143. See if the IP addresses in two APR socket addresses are
  144. equivalent.  Appropriate logic is present for comparing
  145. IPv4-mapped IPv6 addresses with IPv4 addresses.
  146.  
  147.   $ret = $addr1->equal($addr2);
  148.  
  149. =over 4
  150.  
  151. =item obj: C<$addr1>
  152. ( C<L<APR::SockAddr object|docs::2.0::api::APR::SockAddr>> )
  153.  
  154. One of the APR socket addresses.
  155.  
  156. =item arg1: C<$addr2>
  157. ( C<L<APR::SockAddr object|docs::2.0::api::APR::SockAddr>> )
  158.  
  159. The other APR socket address.
  160.  
  161. =item ret: C<$ret> ( integer )
  162.  
  163. =item since: subject to change
  164.  
  165. =back
  166.  
  167. The return value will be non-zero if the addresses
  168. are equivalent.
  169.  
  170.  
  171. =head1 See Also
  172.  
  173. L<mod_perl 2.0 documentation|docs::2.0::index>.
  174.  
  175.  
  176.  
  177.  
  178. =head1 Copyright
  179.  
  180. mod_perl 2.0 and its core modules are copyrighted under
  181. The Apache Software License, Version 2.0.
  182.  
  183.  
  184.  
  185.  
  186. =head1 Authors
  187.  
  188. L<The mod_perl development team and numerous
  189. contributors|about::contributors::people>.
  190.  
  191. =cut
  192.  
  193.