espelhamento de https://github.com/VVelox/Net-Connection-Sort.git
cleanup and note changes
Esse commit está contido em:
pai
b5301ee773
commit
b5b80708b0
3
Changes
3
Changes
|
@ -1,5 +1,8 @@
|
|||
Revision history for Net-Connection-Sort
|
||||
|
||||
0.1.0 2023-06-01/13:00
|
||||
- Add unsorted.
|
||||
|
||||
0.0.1 2019-07-30/02:30
|
||||
- Remove a bit of unused code that prevented one
|
||||
method from running.
|
||||
|
|
12
MANIFEST
12
MANIFEST
|
@ -5,7 +5,6 @@ lib/Net/Connection/Sort/host_fl.pm
|
|||
lib/Net/Connection/Sort/host_l.pm
|
||||
lib/Net/Connection/Sort/host_lf.pm
|
||||
lib/Net/Connection/Sort/pid.pm
|
||||
lib/Net/Connection/Sort/none.pm
|
||||
lib/Net/Connection/Sort/proto.pm
|
||||
lib/Net/Connection/Sort/port_f.pm
|
||||
lib/Net/Connection/Sort/port_fa.pm
|
||||
|
@ -16,6 +15,7 @@ lib/Net/Connection/Sort/ptr_l.pm
|
|||
lib/Net/Connection/Sort/state.pm
|
||||
lib/Net/Connection/Sort/uid.pm
|
||||
lib/Net/Connection/Sort/user.pm
|
||||
lib/Net/Connection/Sort/unsorted.pm
|
||||
Makefile.PL
|
||||
MANIFEST This list of files
|
||||
README.md
|
||||
|
@ -35,21 +35,23 @@ t/12-load.t
|
|||
t/13-load.t
|
||||
t/14-load.t
|
||||
t/15-load.t
|
||||
t/manifest.t
|
||||
t/pod-coverage.t
|
||||
t/pod.t
|
||||
t/16-load.t
|
||||
t/host_f.t
|
||||
t/host_fl.t
|
||||
t/host_l.t
|
||||
t/host_lf.t
|
||||
t/manifest.t
|
||||
t/pid.t
|
||||
t/proto.t
|
||||
t/pod-coverage.t
|
||||
t/pod.t
|
||||
t/port_f.t
|
||||
t/port_fa.t
|
||||
t/port_l.t
|
||||
t/port_la.t
|
||||
t/proto.t
|
||||
t/ptr_f.t
|
||||
t/ptr_l.t
|
||||
t/state.t
|
||||
t/uid.t
|
||||
t/unsorted.t
|
||||
t/user.t
|
||||
|
|
18
ignore.txt
18
ignore.txt
|
@ -1,18 +0,0 @@
|
|||
Makefile
|
||||
Makefile.old
|
||||
Build
|
||||
Build.bat
|
||||
META.*
|
||||
MYMETA.*
|
||||
.build/
|
||||
_build/
|
||||
cover_db/
|
||||
blib/
|
||||
inc/
|
||||
.lwpcookies
|
||||
.last_cover_stats
|
||||
nytprof.out
|
||||
pod2htm*.tmp
|
||||
pm_to_blib
|
||||
Net-Connection-Sort-*
|
||||
Net-Connection-Sort-*.tar.gz
|
|
@ -199,14 +199,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -179,14 +179,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -180,14 +180,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -179,14 +179,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -180,14 +180,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -184,14 +184,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -163,14 +163,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -174,14 +174,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -163,14 +163,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -176,14 +176,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -157,14 +157,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -182,14 +182,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -182,14 +182,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -157,14 +157,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -179,14 +179,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package Net::Connection::Sort::none;
|
||||
package Net::Connection::Sort::unsorted;
|
||||
|
||||
use 5.006;
|
||||
use strict;
|
||||
|
@ -6,20 +6,20 @@ use warnings;
|
|||
|
||||
=head1 NAME
|
||||
|
||||
Net::Connection::Sort::none - Returns what is passed to it.
|
||||
Net::Connection::Sort::unsorted - Pass though. Does returns exactly what it was given.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
Version 0.0.0
|
||||
Version 0.0.1
|
||||
|
||||
=cut
|
||||
|
||||
our $VERSION = '0.0.0';
|
||||
our $VERSION = '0.0.1';
|
||||
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use Net::Connection::Sort::none;
|
||||
use Net::Connection::Sort::unsorted;
|
||||
use Net::Connection;
|
||||
use Data::Dumper;
|
||||
|
||||
|
@ -31,9 +31,8 @@ our $VERSION = '0.0.0';
|
|||
'local_port' => '11132',
|
||||
'sendq' => '1',
|
||||
'recvq' => '0',
|
||||
'state' => 'ESTABLISHED',
|
||||
'state' => 'LISTEN',
|
||||
'proto' => 'tcp4'
|
||||
'uid' => 33,
|
||||
}),
|
||||
Net::Connection->new({
|
||||
'foreign_host' => '1.1.1.1',
|
||||
|
@ -42,9 +41,8 @@ our $VERSION = '0.0.0';
|
|||
'local_port' => '11132',
|
||||
'sendq' => '1',
|
||||
'recvq' => '0',
|
||||
'state' => 'ESTABLISHED',
|
||||
'state' => 'FIN_WAIT_2',
|
||||
'proto' => 'tcp4'
|
||||
'uid' => 0,
|
||||
}),
|
||||
Net::Connection->new({
|
||||
'foreign_host' => '5.5.5.5',
|
||||
|
@ -53,11 +51,9 @@ our $VERSION = '0.0.0';
|
|||
'local_port' => '11132',
|
||||
'sendq' => '1',
|
||||
'recvq' => '0',
|
||||
'state' => 'ESTABLISHED',
|
||||
'state' => 'TIME_WAIT',
|
||||
'proto' => 'tcp4'
|
||||
'uid' => 1000,
|
||||
}),
|
||||
# as no UID is specified, the value of 0 will just be used instead
|
||||
Net::Connection->new({
|
||||
'foreign_host' => '3.3.3.3',
|
||||
'local_host' => '4.4.4.4',
|
||||
|
@ -70,7 +66,7 @@ our $VERSION = '0.0.0';
|
|||
}),
|
||||
);
|
||||
|
||||
my $sorter=$sorter=Net::Connection::Sort::none->new;
|
||||
my $sorter=$sorter=Net::Connection::Sort::unsorted->new;
|
||||
|
||||
@objects=$sorter->sorter( \@objects );
|
||||
|
||||
|
@ -84,7 +80,7 @@ This initiates the module.
|
|||
|
||||
No arguments are taken and this will always succeed.
|
||||
|
||||
my $sorter=$sorter=Net::Connection::Sort::uid->new;
|
||||
my $sorter=$sorter=Net::Connection::Sort::state->new;
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -157,14 +153,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
|
@ -188,14 +188,6 @@ You can also look for information at:
|
|||
|
||||
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Connection-Sort>
|
||||
|
||||
=item * AnnoCPAN: Annotated CPAN documentation
|
||||
|
||||
L<http://annocpan.org/dist/Net-Connection-Sort>
|
||||
|
||||
=item * CPAN Ratings
|
||||
|
||||
L<https://cpanratings.perl.org/d/Net-Connection-Sort>
|
||||
|
||||
=item * Search CPAN
|
||||
|
||||
L<https://metacpan.org/release/Net-Connection-Sort>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#!perl -T
|
||||
use 5.006;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
|
||||
plan tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use_ok( 'Net::Connection::Sort::unsorted' ) || print "Bail out!\n";
|
||||
}
|
||||
|
||||
diag( "Testing Net::Connection::Sort::unsorted $Net::Connection::Sort::unsorted::VERSION, Perl $], $^X" );
|
|
@ -0,0 +1,78 @@
|
|||
#!perl -T
|
||||
use 5.006;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
use Net::Connection;
|
||||
|
||||
my @objects=(
|
||||
Net::Connection->new({
|
||||
'foreign_host' => '3.3.3.3',
|
||||
'local_host' => '4.4.4.4',
|
||||
'foreign_port' => '22',
|
||||
'local_port' => '11132',
|
||||
'sendq' => '1',
|
||||
'recvq' => '0',
|
||||
'state' => 'LISTEN',
|
||||
'proto' => 'tcp4'
|
||||
}),
|
||||
Net::Connection->new({
|
||||
'foreign_host' => '1.1.1.1',
|
||||
'local_host' => '2.2.2.2',
|
||||
'foreign_port' => '22',
|
||||
'local_port' => '11132',
|
||||
'sendq' => '1',
|
||||
'recvq' => '0',
|
||||
'state' => 'FIN_WAIT_2',
|
||||
'proto' => 'tcp4'
|
||||
}),
|
||||
Net::Connection->new({
|
||||
'foreign_host' => '5.5.5.5',
|
||||
'local_host' => '6.6.6.6',
|
||||
'foreign_port' => '22',
|
||||
'local_port' => '11132',
|
||||
'sendq' => '1',
|
||||
'recvq' => '0',
|
||||
'state' => 'TIME_WAIT',
|
||||
'proto' => 'tcp4'
|
||||
}),
|
||||
Net::Connection->new({
|
||||
'foreign_host' => '3.3.3.3',
|
||||
'local_host' => '4.4.4.4',
|
||||
'foreign_port' => '22',
|
||||
'local_port' => '11132',
|
||||
'sendq' => '1',
|
||||
'recvq' => '0',
|
||||
'state' => 'ESTABLISHED',
|
||||
'proto' => 'tcp4'
|
||||
}),
|
||||
);
|
||||
|
||||
BEGIN {
|
||||
use_ok( 'Net::Connection::Sort::unsorted' ) || print "Bail out!\n";
|
||||
}
|
||||
|
||||
diag( "Testing Net::Connection::Sort::unsorted $Net::Connection::Sort::unsorted::VERSION, Perl $], $^X" );
|
||||
|
||||
my $sorter;
|
||||
my $worked=0;
|
||||
eval{
|
||||
$sorter=Net::Connection::Sort::unsorted->new;
|
||||
$worked=1;
|
||||
};
|
||||
ok( $worked eq 1, 'sorter init') or die ('Net::Connection::Sort::state->new resulted in... '.$@);
|
||||
|
||||
my @sorted;
|
||||
$worked=0;
|
||||
eval{
|
||||
@sorted=$sorter->sorter( \@objects );
|
||||
$worked=1;
|
||||
};
|
||||
ok( $worked eq 1, 'sort') or die ('Net::Connection::Sort::state->sorter(@objects) resulted in... '.$@);
|
||||
|
||||
ok( $sorted[0]->state =~ 'LISTEN', 'sort order 0') or die ('The state for 0 is not LISTEN');
|
||||
ok( $sorted[1]->state =~ 'FIN_WAIT_2', 'sort order 1') or die ('The state for 1 is not FIN_WAIT_2');
|
||||
ok( $sorted[2]->state =~ 'TIME_WAIT', 'sort order 2') or die ('The state for 2 is not TIME_WAIT');
|
||||
ok( $sorted[3]->state =~ 'ESTABLISHED', 'sort order 2') or die ('The state for 3 is not ESTABLISHED');
|
||||
|
||||
done_testing(7);
|
Carregando…
Referência em uma nova issue