line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
8
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
3
|
1
|
|
|
1
|
|
7
|
use vars qw($VERSION);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
79
|
|
4
|
|
|
|
|
|
|
$VERSION = "0.17";
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Net::Shared::Remote;
|
7
|
1
|
|
|
1
|
|
6
|
use IO::Socket;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
8
|
1
|
|
|
1
|
|
988
|
use Storable qw(freeze thaw);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4695
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new
|
11
|
|
|
|
|
|
|
{
|
12
|
1
|
|
|
1
|
0
|
33
|
my ($proto, %config) = @_;
|
13
|
1
|
|
33
|
|
|
26
|
my $class = ref($proto) || $proto;
|
14
|
1
|
|
|
|
|
21
|
my $self = {};
|
15
|
1
|
|
|
|
|
227
|
$self->{name} = crypt($config{name}, $config{name});
|
16
|
1
|
|
|
|
|
3
|
$self->{ref} = $config{ref};
|
17
|
1
|
50
|
|
|
|
214
|
$self->{port} = exists($config{port}) ? $config{port} : 0;
|
18
|
1
|
50
|
|
|
|
24
|
$self->{address} = exists($config{address}) ? $config{address} : '127.0.0.1';
|
19
|
1
|
50
|
|
|
|
154
|
$self->{debug} = exists($config{debug}) ? $config{name} : 0;
|
20
|
1
|
50
|
|
|
|
27
|
$self->{response} = exists($config{response}) ? $config{response} : "\bl\b";
|
21
|
|
|
|
|
|
|
|
22
|
1
|
50
|
|
|
|
3
|
if ($config{debug})
|
23
|
|
|
|
|
|
|
{
|
24
|
0
|
|
|
|
|
0
|
print "Constructor for ", $config{name}, ":\n";
|
25
|
0
|
|
|
|
|
0
|
print "\tType of class: ", $class, "\n";
|
26
|
0
|
|
|
|
|
0
|
print "\tReferring to Variable: ", $config{ref}, "\n";
|
27
|
0
|
|
|
|
|
0
|
print "\tAddress ", $config{address}, "\n";
|
28
|
0
|
|
|
|
|
0
|
print "\tPort: ", $self->{port}, "\n";
|
29
|
0
|
|
|
|
|
0
|
print "\n";
|
30
|
|
|
|
|
|
|
}
|
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
19
|
bless ($self, $class);
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub set_port
|
36
|
|
|
|
|
|
|
{
|
37
|
0
|
|
|
0
|
0
|
0
|
my ($self, $port) = @_;
|
38
|
0
|
|
|
|
|
0
|
$self->{port} = $port;
|
39
|
|
|
|
|
|
|
}
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub set_addr
|
42
|
|
|
|
|
|
|
{
|
43
|
0
|
|
|
0
|
0
|
0
|
my ($self, $addr) = @_;
|
44
|
0
|
|
|
|
|
0
|
$self->{addr} = $addr;
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub destroy_variable
|
48
|
|
|
|
|
|
|
{
|
49
|
1
|
|
|
1
|
0
|
3
|
my $self = shift;
|
50
|
1
|
|
|
|
|
3
|
undef $self;
|
51
|
|
|
|
|
|
|
}
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub prepare_data
|
54
|
|
|
|
|
|
|
{
|
55
|
1
|
|
|
1
|
0
|
2
|
my ($self,$data) = @_;
|
56
|
1
|
|
|
|
|
6
|
my $serialized_data = freeze($data);
|
57
|
1
|
|
|
|
|
46
|
return join('*',map{ord}split(//,$serialized_data));
|
|
27
|
|
|
|
|
41
|
|
58
|
|
|
|
|
|
|
}
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub build_header
|
61
|
|
|
|
|
|
|
{
|
62
|
2
|
|
|
2
|
0
|
14
|
my $self = shift;
|
63
|
2
|
|
|
|
|
489
|
return crypt(crypt($self->{ref},$self->{ref}),$self->{ref});
|
64
|
|
|
|
|
|
|
}
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub cleanup
|
67
|
|
|
|
|
|
|
{
|
68
|
0
|
|
|
0
|
0
|
|
my ($self, $error_value) = @_;
|
69
|
0
|
|
|
|
|
|
$self->destroy_variable;
|
70
|
0
|
|
|
|
|
|
return $error_value;
|
71
|
|
|
|
|
|
|
}
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
"JAPH"; |