| 1 | # Copyright 1995,2002 Spider Boardman. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # Automatic licensing for this software is available. This software | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # can be copied and used under the terms of the GNU Public License, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # version 1 or (at your option) any later version, or under the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # terms of the Artistic license. Both of these can be found with | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # the Perl distribution, which this software is intended to augment. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | # rcsid: "@(#) $Id: UNIX.dat,v 1.22 2002/03/30 10:11:08 spider Exp $" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | package Net::UNIX; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use 5.004_04; # new minimum Perl version for this package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | #use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub carp { require Carp; goto &Carp::carp; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
carp: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub croak { require Carp; goto &Carp::croak; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
croak: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS *AUTOLOAD); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | $VERSION = '1.0'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | eval "sub Version { __PACKAGE__ . ' v$VERSION' }"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
Version: not called CC=1 SCAR=1.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | ▶ | use AutoLoader; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | #use Exporter (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 1 | ▶ | use Net::Gen 1.0 qw(/pack_sockaddr$/ :sockvals :families); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 1 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 1 | @ISA = 'Net::Gen'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | # Items to export into callers namespace by default. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | # (Move infrequently used names to @EXPORT_OK below.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | @EXPORT = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | @EXPORT_OK = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | pack_sockaddr_un | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | unpack_sockaddr_un | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | %EXPORT_TAGS = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | routines => [qw(pack_sockaddr_un unpack_sockaddr_un)], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ALL => [@EXPORT, @EXPORT_OK], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | *AUTOLOAD = \$Net::Gen::AUTOLOAD; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | ;# sub AUTOLOAD inherited from Net::Gen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | ;# since 5.003_96 will break simple subroutines with inherited autoload, cheat | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | sub AUTOLOAD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | #$Net::Gen::AUTOLOAD = $AUTOLOAD; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | goto &Net::Gen::AUTOLOAD; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | # Preloaded methods go here. Autoload methods go after __END__, and are | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | # processed by the autosplit program. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | ;# No additional sockopts for UNIX-domain sockets (?) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 1 | my $sun_path_len = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | length(Socket::unpack_sockaddr_un(Socket::pack_sockaddr_un(''))); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | #& _canonpath($path) : returns NUL-padded $path for sun_addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | sub _canonpath ($) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 10 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_canonpath: called CC=4 SCAR=14.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 10 | my $path = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 10 | my $ix; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | # extend to proper length | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 10 | $ix = index($path, "\0"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 10 | ▶ | if ($ix >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 5 | ▶ | substr($path,$ix) = "\0" x ($sun_path_len - $ix) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | if $ix < $sun_path_len; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 5 | $ix = length($path); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 5 | ▶ | if ($ix < $sun_path_len) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 5 | $path .= "\0" x ($sun_path_len - $ix); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | $path .= "\0"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 10 | $path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | #& pack_sockaddr_un([$family,] $path) : $packed_addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | sub pack_sockaddr_un ($;$) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pack_sockaddr_un: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 5 | my(@args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 5 | ▶ | unshift(@args, AF_UNIX) if @args == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 5 | pack_sockaddr($args[0], _canonpath($args[1])); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | #& unpack_sockaddr_un($sockaddr_un) : [$fam,] $path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | sub unpack_sockaddr_un ($) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unpack_sockaddr_un: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my $addr = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | my ($fam,$path) = unpack_sockaddr($addr); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | my $nul = index($path, "\0"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | if ($nul >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | substr($path, $nul) = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | $fam ||= AF_UNIX; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$fam ||= 1
MC/DC0%0/1
$fam ||= 1
$fam
Truth table0%0/2
A
A= $fam
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | wantarray ? ($fam, $path) : $path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 1 | my $debug = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | #& _debug($this, [$newval]) : oldval | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | sub _debug | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 142 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_debug: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 1 | ▶ | use attrs qw(locked); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 142 | my ($this,$newval) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 142 | ▶ | return $this->debug($newval) if ref $this; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 18 | my $prev = $debug; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 18 | ▶ | $debug = 0+$newval if defined $newval; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 18 | $prev; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 1 | my %keyhandlers = (thispath => \&_setbindpath, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | destpath => \&_setconnpath, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | unbuffered_IO => \&_setbuf_unbuf, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | unbuffered_io => \&_setbuf_unbuf, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 1 | my @Keys = qw(unbuffered_input unbuffered_output); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | my %Keys; # for storing the registrations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | #& new($class, [\%params]) : {$obj | undef} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | sub new | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=11 SCAR=26.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 1 | ▶ | use attrs qw(locked); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 5 | my $whoami = $_[0]->_trace(\@_,1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 5 | my($class,@Args,$self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 5 | $self = $class->SUPER::new(@Args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 5 | ▶ | $class = ref $class if ref $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 5 | ▶ | ($self || $class)->_trace(\@_,2,", self" . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self || $class
MC/DC0%0/2
$self || $class
$self
$class
Truth table33%1/3
A || B
A= $selfB= $class
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | (defined $self ? "=$self" : " undefined") . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | " after sub-new"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 5 | ▶ | if ($self) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | # register our keys and their handlers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 5 | ▶ | if (%Keys) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 4 | $ {*$self}{Keys} = { %Keys }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 1 | ▶ | $self->register_param_keys(\@Keys) if @Keys; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 1 | $self->register_param_handlers(\%keyhandlers); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 1 | %Keys = %{ $ {*$self}{Keys} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | # register our socket options | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | # none for AF_UNIX? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | # set our expected parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 5 | $self->setparams({PF => PF_UNIX, AF => AF_UNIX, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | unbuffered_output => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | unbuffered_input => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | type => SOCK_DGRAM}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | -1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 5 | ▶ | if ($class eq __PACKAGE__) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 2 | ▶ | unless ($self->init(@Args)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | local $!; # protect errno | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | undef $self; # from the side-effects of this | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | undef $self; # another statement needed for unwinding | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 5 | ▶ | if ($debug) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | if ($self) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | print STDERR __PACKAGE__ . "::new returning self=$self\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | print STDERR __PACKAGE__ . "::new returning undef\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 5 | $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | #& _setbindpath($self, 'thispath', $path) : {'' | "carp string"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | sub _setbindpath | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 3 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_setbindpath: called CC=3 SCAR=13.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 3 | my($self,$what,$path) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 3 | my $ix; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 3 | ▶ | if (!defined($path)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | # removing, so cooperate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | delete $ {*$self}{Parms}{srcaddrlist}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | return ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | # canonicalize the path to be of the right length, if possible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 3 | $path = _canonpath($path); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 3 | $ix = index($path, "\0"); # check for NUL-termination | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 3 | ▶ | if (!$ix) { # empty path is not a bind | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | delete $ {*$self}{Parms}{srcaddrlist}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | $_[2] = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 3 | $ {*$self}{Parms}{srcaddrlist} = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 3 | [pack_sockaddr_un($self->getparam('AF',AF_UNIX,1), $path)]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 3 | ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | #& _setconnpath($self, 'destpath', $path) : {'' | "carp string"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | sub _setconnpath | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_setconnpath: called CC=3 SCAR=12.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 2 | my($self,$what,$path) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 2 | my $ix; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 2 | ▶ | if (!defined($path)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | # removing, so cooperate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | delete $ {*$self}{Parms}{dstaddrlist}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | return ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | # canonicalize the path to be of the right length, if possible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 2 | $path = _canonpath($path); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 2 | $ix = index($path, "\0"); # check for NUL-termination | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 2 | ▶ | if (!$ix) { # empty path? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | "$what parameter has no path: $path"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | else { # just try it here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 2 | $ {*$self}{Parms}{dstaddrlist} = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 2 | [pack_sockaddr_un($self->getparam('AF',AF_UNIX,1), $path)]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 2 | ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | #& _init($self, whatpath[, $path][, \%params]) : {$self | undef} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | sub _init | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init: called CC=28 SCAR=37.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 1 | ▶ | use attrs qw(locked method); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 5 | my ($self,$what,@args,$path,$parms) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 5 | ▶ | if (@args == 1 or @args == 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@args == 1 or @args == 2
MC/DC100%2/2
@args == 1 or @args == 2
@args == 1
@args == 2
Truth table100%3/3
A or B
A= @args == 1B= @args == 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 4 | $parms = $args[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 4 | ▶ | $parms = undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$parms and ref $parms eq "HASH"
MC/DC50%1/2
$parms and ref $parms eq "HASH"
$parms
ref $parms eq "HASH"
Truth table66%2/3
A and B
A= $parmsB= ref $parms eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | unless $parms and ref($parms) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 4 | $path = $args[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 4 | ▶ | $path = undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $path and ref $path
MC/DC50%1/2
defined $path and ref $path
defined $path
ref $path
Truth table66%2/3
A and B
A= defined $pathB= ref $path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | if defined($path) and ref($path); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 5 | ▶ | croak("Invalid call to " . __PACKAGE__ . "::init(@_)") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
@args == 2 and not $parms or @args > 2 or not $what
@args == 2 and not $parms or @args > 2
@args == 2 and not $parms
MC/DC0%0/4
@args == 2 and not $parms or @args > 2 or not $what
@args == 2
not $parms
@args > 2
not $what
Truth table28%2/7
A and not(B) or C or not(D)
A= @args == 2B= not $parmsC= @args > 2D= not $what
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | if @args == 2 and !$parms or @args > 2 or !$what; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 5 | ▶ | $parms ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$parms ||= {}
MC/DC100%1/1
$parms ||= {}
$parms
Truth table100%2/2
A
A= $parms
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 5 | ▶ | $$parms{$what} = $path if defined $path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 5 | ▶ | return undef unless $self->SUPER::init($parms); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 5 | ▶ | if (scalar %$parms) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 4 | ▶ | return undef unless $self->setparams($parms); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 5 | ▶ | $self->setparams({netgen_fakeconnect=>1},-1) if | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | $self->getparam('type') == SOCK_DGRAM; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 5 | ▶ | if ($self->getparams([qw(srcaddr srcaddrlist dstaddr dstaddrlist)],1) >0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 3 | ▶ | return undef unless $self->isopen or $self->open; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->isopen or $self->open
MC/DC0%0/2
$self->isopen or $self->open
$self->isopen
$self->open
Truth table33%1/3
A or B
A= $self->isopenB= $self->open
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 3 | ▶ | if ($self->getparams([qw(srcaddr srcaddrlist)],1) > 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 2 | ▶ | return undef unless $self->isbound or $self->bind; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->isbound or $self->bind
MC/DC0%0/2
$self->isbound or $self->bind
$self->isbound
$self->bind
Truth table33%1/3
A or B
A= $self->isboundB= $self->bind
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 3 | ▶ | if ($self->getparams([qw(dstaddr dstaddrlist)],1) > 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 1 | ▶ | return undef unless $self->isconnected or $self->connect or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition22%2/9
$self->isconnected or $self->connect or $self->isconnecting and not $self->blocking
$self->isconnected or $self->connect
$self->isconnecting and not $self->blocking
MC/DC0%0/4
$self->isconnected or $self->connect or $self->isconnecting and not $self->blocking
$self->isconnected
$self->connect
$self->isconnecting
not $self->blocking
Truth table20%1/5
A or B or C and not(D)
A= $self->isconnectedB= $self->connectC= $self->isconnectingD= not $self->blocking
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | $self->isconnecting and !$self->blocking; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 5 | $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | #& init($self [, $destpath][, \%params]) : {$self | undef} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | sub init | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 2 | my ($self,@args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 2 | $self->_init('destpath',@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | #& connect($self [, $destpath] [, \%newparams]) : boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | sub connect | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
connect: called CC=11 SCAR=27.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 1 | ▶ | use attrs qw(locked method); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 2 | my($self,$path,$parms) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 2 | ▶ | if (@_ > 3 or @_ == 3 and (!ref($parms) or ref($path))) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
@_ > 3 or @_ == 3 and !ref($parms) || ref $path
@_ == 3 and !ref($parms) || ref $path
not ref $parms or ref $path
MC/DC0%0/4
@_ > 3 or @_ == 3 and !ref($parms) || ref $path
@_ > 3
@_ == 3
not ref $parms
ref $path
Truth table40%2/5
A or B and not(C) or D
A= @_ > 3B= @_ == 3C= not ref $parmsD= ref $path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | croak("Invalid arguments to " . __PACKAGE__ . "::connect(@_), called"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 2 | ▶ | if (@_ == 2 and ref $path) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@_ == 2 and ref $path
MC/DC0%0/2
@_ == 2 and ref $path
@_ == 2
ref $path
Truth table33%1/3
A and B
A= @_ == 2B= ref $path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | $parms = $path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | undef $path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 2 | ▶ | $parms ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$parms ||= {}
MC/DC100%1/1
$parms ||= {}
$parms
Truth table100%2/2
A
A= $parms
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 2 | ▶ | if (defined $path) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 1 | $$parms{destpath} = $path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 2 | ▶ | if (@_ > 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 1 | ▶ | return unless $self->setparams($parms); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 2 | $self->SUPER::connect; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | #& format_addr({$class|$obj} , $sockaddr) : $string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | sub format_addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
format_addr: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | my ($this,$addr) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | my ($fam,$sdata) = unpack_sockaddr($addr); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | if ($fam == AF_UNIX) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | $sdata = unpack_sockaddr_un($addr); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $sdata = $this->SUPER::format_addr($addr); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | $sdata; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | # autoloaded methods go after the END token (& pod) below | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||