line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Power::Outlet::Common::IP; |
2
|
13
|
|
|
13
|
|
85217
|
use strict; |
|
13
|
|
|
|
|
28
|
|
|
13
|
|
|
|
|
336
|
|
3
|
13
|
|
|
13
|
|
57
|
use warnings; |
|
13
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
280
|
|
4
|
13
|
|
|
13
|
|
52
|
use base qw{Power::Outlet::Common}; |
|
13
|
|
|
|
|
19
|
|
|
13
|
|
|
|
|
4757
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.48'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Power::Outlet::Common::IP - Power::Outlet base class for Internet Protocol power outlet |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use base qw{Power::Outlet::Common::IP}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Power::Outlet::Common::IP is a base package for controlling and querying Internet based power outlet. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 USAGE |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use base qw{Power::Outlet::Common::IP}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 PROPERTIES |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 host |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Sets and returns the hostname or IP address. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Manufacturer Default: 192.168.1.254 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub host { |
37
|
12
|
|
|
12
|
1
|
8651
|
my $self=shift; |
38
|
12
|
100
|
|
|
|
44
|
$self->{"host"}=shift if @_; |
39
|
12
|
100
|
|
|
|
39
|
$self->{"host"}=$self->_host_default unless defined $self->{"host"}; |
40
|
12
|
|
|
|
|
47
|
return $self->{"host"}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
|
0
|
sub _host_default {"192.168.1.254"}; #MFG Default for iBoot |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 port |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Sets and returns the TCP port |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Manufacturer Default: 80 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub port { |
54
|
12
|
|
|
12
|
1
|
25
|
my $self=shift; |
55
|
12
|
100
|
|
|
|
34
|
$self->{"port"}=shift if @_; |
56
|
12
|
100
|
|
|
|
44
|
$self->{"port"}=$self->_port_default unless defined $self->{"port"}; |
57
|
12
|
|
|
|
|
39
|
return $self->{"port"}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
|
|
sub _port_default {"80"}; #MFG Default for iBoot |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub _name_default { |
63
|
0
|
|
|
0
|
|
|
my $self=shift; |
64
|
0
|
|
|
|
|
|
return $self->host; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 BUGS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Please log on RT and send an email to the author. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SUPPORT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
DavisNetworks.com supports all Perl applications including this package. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 AUTHOR |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Michael R. Davis |
78
|
|
|
|
|
|
|
CPAN ID: MRDVT |
79
|
|
|
|
|
|
|
DavisNetworks.com |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
The full text of the license can be found in the LICENSE file included with this module. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 SEE ALSO |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1; |