« /usr/local/lib/perl5/5.44.0/x86_64-linux/Digest/SHA.pm
↑ Summary
/usr/local/lib/perl5/5.44.0/x86_64-linux/Storable.pm »
| 1 | # IO::Socket::UNIX.pm | ||||||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||||||
| 3 | # Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved. | ||||||||||||||||||||||||||||||||
| 4 | # This program is free software; you can redistribute it and/or | ||||||||||||||||||||||||||||||||
| 5 | # modify it under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | package IO::Socket::UNIX; | ||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use IO::Socket; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 5 | our @ISA = qw(IO::Socket); | |||||||||||||||||||||||||||||||
| 14 | 5 | our $VERSION = "1.56"; | |||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||
| 16 | 5 | IO::Socket::UNIX->register_domain( AF_UNIX ); | |||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 19 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | unshift(@_, "Peer") if @_ == 1; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 21 | 0 | return $class->SUPER::new(@_); | |||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub configure { | ||||||||||||||||||||||||||||||
|
Subroutine
configure: not called CC=13 SCAR=52.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 25 | 0 | my($sock,$arg) = @_; | |||||||||||||||||||||||||||||||
| 26 | 0 | my($bport,$cport); | |||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | my $type = $arg->{Type} || SOCK_STREAM; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$arg->{'Type'} || 1
MC/DC0%0/1
$arg->{'Type'} || 1
$arg->{'Type'}
Truth table0%0/2
A
A= $arg->{'Type'}
| |||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | $sock->socket(AF_UNIX, $type, 0) or | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 31 | return undef; | ||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | if(exists $arg->{Blocking}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | $sock->blocking($arg->{Blocking}) or | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 35 | return undef; | ||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | if(exists $arg->{Local}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 38 | 0 | my $addr = sockaddr_un($arg->{Local}); | |||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | $sock->bind($addr) or | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 40 | return undef; | ||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if(exists $arg->{Listen} && $type != SOCK_DGRAM) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
exists $arg->{"Listen"} and $type != 2
MC/DC0%0/2
exists $arg->{"Listen"} and $type != 2
exists $arg->{"Listen"}
$type != 2
Truth table0%0/3
A and B
A= exists $arg->{"Listen"}B= $type != 2
| |||||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | $sock->listen($arg->{Listen} || 5) or | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$arg->{'Listen'} || 5
MC/DC0%0/1
$arg->{'Listen'} || 5
$arg->{'Listen'}
Truth table0%0/2
A
A= $arg->{'Listen'}
| |||||||||||||||||||||||||||||||||
| 44 | return undef; | ||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||
| 46 | elsif(exists $arg->{Peer}) { | ||||||||||||||||||||||||||||||||
| 47 | 0 | my $addr = sockaddr_un($arg->{Peer}); | |||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | $sock->connect($addr) or | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 49 | return undef; | ||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | 0 | $sock; | |||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub hostpath { | ||||||||||||||||||||||||||||||
|
Subroutine
hostpath: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | @_ == 1 or croak 'usage: $sock->hostpath()'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | my $n = $_[0]->sockname || return undef; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$_[0]->sockname || (return undef)
MC/DC0%0/1
$_[0]->sockname || (return undef)
$_[0]->sockname
Truth table0%0/2
A
A= $_[0]->sockname
| |||||||||||||||||||||||||||||||||
| 58 | 0 | (sockaddr_un($n))[0]; | |||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | sub peerpath { | ||||||||||||||||||||||||||||||
|
Subroutine
peerpath: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | @_ == 1 or croak 'usage: $sock->peerpath()'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | my $n = $_[0]->peername || return undef; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$_[0]->peername || (return undef)
MC/DC0%0/1
$_[0]->peername || (return undef)
$_[0]->peername
Truth table0%0/2
A
A= $_[0]->peername
| |||||||||||||||||||||||||||||||||
| 64 | 0 | (sockaddr_un($n))[0]; | |||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||
| 67 | 5 | 1; # Keep require happy | |||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||
| 69 | __END__ | ||||||||||||||||||||||||||||||||