From 477905f567ce4a5fd771033b33f5092dcdf072c4 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Wed, 17 Jul 2019 05:09:57 -0500 Subject: [PATCH] add git links and update README/changes for release --- Net-Connection-Match/Changes | 5 +- Net-Connection-Match/README | 71 ++++++++++++++++--- .../lib/Net/Connection/Match.pm | 6 +- 3 files changed, 69 insertions(+), 13 deletions(-) diff --git a/Net-Connection-Match/Changes b/Net-Connection-Match/Changes index 11fbdd3..e8f266f 100644 --- a/Net-Connection-Match/Changes +++ b/Net-Connection-Match/Changes @@ -1,5 +1,4 @@ Revision history for Net-Connection-Match -0.01 Date/time - First version, released on an unsuspecting world. - +0.0.0 2019-07-17/05:15 + - Initial release. diff --git a/Net-Connection-Match/README b/Net-Connection-Match/README index c1df07f..4fb8b2a 100644 --- a/Net-Connection-Match/README +++ b/Net-Connection-Match/README @@ -1,16 +1,66 @@ Net-Connection-Match -The README is used to introduce the module and provide instructions on -how to install the module, any machine dependencies it may have (for -example C compilers and installed libraries) and any other information -that should be provided before the module is installed. +Provides a easy to use method for checking if a Net::Connection +object mathes a series of checks. -A README file is required for CPAN modules since CPAN extracts the README -file from a module distribution so that people browsing the archive -can use it to get an idea of the module's uses. It is usually a good idea -to provide version information here so that people can decide whether -fixes for the module are worth downloading. +Currently can do matching based off of the following. + * CIDR + * Ports + * Protocol + * State + * PTR + + use Net::Connection::Match; + use Net::Connection; + + my $connection_args={ + foreign_host=>'10.0.0.1', + foreign_port=>'22', + local_host=>'10.0.0.2', + local_port=>'12322', + proto=>'tcp4', + state=>'LISTEN', + }; + my $conn=Net::Connection->new( $connection_args ); + + my %args=( + checks=>[ + { + type=>'Ports', + invert=>0, + args=>{ + ports=>[ + '22', + ], + lports=>[ + '53', + ], + fports=>[ + '12345', + ], + } + }, + { + type=>'Protos', + invert=>0, + args=>{ + protos=>[ + 'tcp4', + ], + } + } + ] + ); + + my $checker; + eval{ + $checker=Net::Connection::Match->new( \%args ); + } or die "New failed with...".$@; + + if ( $check->match( $conn ) ){ + print "It matched!\n"; + } INSTALLATION @@ -42,6 +92,9 @@ You can also look for information at: Search CPAN https://metacpan.org/release/Net-Connection-Match + Git Repo + https://gitea.eesdp.org/vvelox/Net-Connection-Match + LICENSE AND COPYRIGHT diff --git a/Net-Connection-Match/lib/Net/Connection/Match.pm b/Net-Connection-Match/lib/Net/Connection/Match.pm index 9ec7534..11cdebc 100644 --- a/Net-Connection-Match/lib/Net/Connection/Match.pm +++ b/Net-Connection-Match/lib/Net/Connection/Match.pm @@ -65,7 +65,7 @@ our $VERSION = '0.0.0'; my $checker; eval{ $checker=Net::Connection::Match->new( \%args ); - }; + } or die "New failed with...".$@; if ( $check->match( $conn ) ){ print "It matched!\n"; @@ -335,6 +335,10 @@ L L +=item * Git Repo + +L + =back