stas 2004/05/21 12:25:46
Modified: t/apr .cvsignore
todo api_status
xs/maps apr_functions.map apr_types.map
Added: xs/APR/IpSubnet APR__IpSubnet.h
t/response/TestAPR ipsubnet.pm
Removed: xs/APR/NetLib APR__NetLib.h
t/response/TestAPR netlib.pm
Log:
rename package APR::NetLib -> APR::IpSubnet to match the class name
Revision Changes Path
1.1 modperl-2.0/xs/APR/IpSubnet/APR__IpSubnet.h
Index: APR__IpSubnet.h
===================================================================
/* Copyright 2001-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
static MP_INLINE
apr_ipsubnet_t *mpxs_apr_ipsubnet_create(pTHX_ SV *classname, apr_pool_t *p,
const char *ipstr,
const char *mask_or_numbits)
{
apr_status_t status;
apr_ipsubnet_t *ipsub = NULL;
status = apr_ipsubnet_create(&ipsub, ipstr, mask_or_numbits, p);
if (status != APR_SUCCESS) {
return NULL;
}
return ipsub;
}
1.13 +2 -2 modperl-2.0/t/apr/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/modperl-2.0/t/apr/.cvsignore,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -u -r1.12 -r1.13
--- .cvsignore 21 May 2004 18:38:51 -0000 1.12
+++ .cvsignore 21 May 2004 19:25:46 -0000 1.13
@@ -6,7 +6,7 @@
finfo.t
flatten.t
lib.t
-netlib.t
+ipsubnet.t
os.t
perlio.t
pool.t
@@ -16,4 +16,4 @@
table.t
threadmutex.t
util.t
-uuid.t
\ No newline at end of file
+uuid.t
1.7 +2 -2 modperl-2.0/todo/api_status
Index: api_status
===================================================================
RCS file: /home/cvs/modperl-2.0/todo/api_status,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -u -r1.6 -r1.7
--- api_status 21 May 2004 18:45:58 -0000 1.6
+++ api_status 21 May 2004 19:25:46 -0000 1.7
@@ -80,8 +80,8 @@
VV src/docs/2.0/api/APR/Error.pod
-- src/docs/2.0/api/APR/Finfo.pod
--- src/docs/2.0/api/APR/NetLib.pod
- XXX: going to be renamed to IpSubNet
+-- src/docs/2.0/api/APR/IpSubnet.pod
+
+V src/docs/2.0/api/APR/PerlIO.pod
1.76 +3 -2 modperl-2.0/xs/maps/apr_functions.map
Index: apr_functions.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -u -r1.75 -r1.76
--- apr_functions.map 21 May 2004 18:36:02 -0000 1.75
+++ apr_functions.map 21 May 2004 19:25:46 -0000 1.76
@@ -500,12 +500,13 @@
apr_gid_get
apr_uid_current
-MODULE=APR::NetLib
+!MODULE=APR::NetLib
-apr_gethostname
!apr_getnameinfo
-apr_getservbyname
!apr_parse_addr_port
-PACKAGE=APR::IpSubnet
+
+MODULE=APR::IpSubnet
apr_ipsubnet_t *:apr_ipsubnet_create | mpxs_ | \
SV *:CLASS, p, ipstr, mask_or_numbits=NULL | new
apr_ipsubnet_test
1.22 +0 -1 modperl-2.0/xs/maps/apr_types.map
Index: apr_types.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/apr_types.map,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -u -r1.21 -r1.22
--- apr_types.map 17 Nov 2003 23:27:11 -0000 1.21
+++ apr_types.map 21 May 2004 19:25:46 -0000 1.22
@@ -16,7 +16,6 @@
apr_shutdown_how_e | UNDEFINED
apr_interface_e | UNDEFINED
-#netlib stuff
struct apr_ipsubnet_t | APR::IpSubnet
#bucket stuff
1.1 modperl-2.0/t/response/TestAPR/ipsubnet.pm
Index: ipsubnet.pm
===================================================================
package TestAPR::ipsubnet;
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::Connection ();
use Apache::RequestRec ();
use APR::IpSubnet ();
use APR::SockAddr ();
use Apache::Const -compile => 'OK';
sub handler {
my $r = shift;
my $c = $r->connection;
my $p = $r->pool;
plan $r, tests => 5;
my $ip = $c->remote_ip;
ok $ip;
ok t_cmp($ip, $c->remote_addr->ip_get,
"remote_ip eq remote_addr->ip_get");
my $ipsub = APR::IpSubnet->new($p, $ip);
ok $ipsub->test($c->remote_addr);
my $reverse_remote_ip = scalar reverse $ip;
ok t_cmp($reverse_remote_ip, scalar reverse($c->remote_addr->ip_get),
"reversed remote_ip eq reversed remote_addr->ip_get");
$ipsub = APR::IpSubnet->new($p, $reverse_remote_ip);
if (!$ipsub) {
ok 1; #this happens on win32
}
else {
ok ! $ipsub->test($c->remote_addr);
}
Apache::OK;
}
1;