line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ISC::DHCPd::Config::Range; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Range - Range config parameter |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role> for methods and attributes without |
10
|
|
|
|
|
|
|
documentation. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
An instance from this class, comes from / will produce: |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
range $lower_attribute_value $upper_attribute_value; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config/SYNOPSIS>. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NOTES |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
L</upper> and L</lower> attributes might change from L<NetAddr::IP> to |
23
|
|
|
|
|
|
|
plain strings in the future. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
24
|
|
|
24
|
|
22742
|
use Moose; |
|
24
|
|
|
|
|
81
|
|
|
24
|
|
|
|
|
221
|
|
28
|
24
|
|
|
24
|
|
170016
|
use NetAddr::IP; |
|
24
|
|
|
|
|
63
|
|
|
24
|
|
|
|
|
259
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
with 'Net::ISC::DHCPd::Config::Role'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 upper |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
This attribute holds a L<NetAddr::IP> object, representing the |
37
|
|
|
|
|
|
|
highest IP address in the range. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has upper => ( |
42
|
|
|
|
|
|
|
is => 'ro', |
43
|
|
|
|
|
|
|
isa => 'NetAddr::IP', |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 lower |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This attribute holds a L<NetAddr::IP> object, representing the |
49
|
|
|
|
|
|
|
lowest IP address in the range. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
has lower => ( |
54
|
|
|
|
|
|
|
is => 'ro', |
55
|
|
|
|
|
|
|
isa => 'NetAddr::IP', |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 regex |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/regex>. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
49
|
|
|
49
|
1
|
381
|
sub regex { qr{^\s* range \s+ (\S+) (?:\s+ (\S*))? ;}x } |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 METHODS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 captured_to_args |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/captured_to_args>. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub captured_to_args { |
75
|
|
|
|
|
|
|
|
76
|
14
|
100
|
|
14
|
1
|
47
|
if (!defined($_[1])) { |
77
|
1
|
|
|
|
|
5
|
return { lower => NetAddr::IP->new($_[0]) }; |
78
|
|
|
|
|
|
|
} else { |
79
|
|
|
|
|
|
|
return { |
80
|
13
|
|
|
|
|
115
|
lower => NetAddr::IP->new($_[0]), |
81
|
|
|
|
|
|
|
upper => NetAddr::IP->new($_[1]), |
82
|
|
|
|
|
|
|
}; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 generate |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/generate>. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub generate { |
93
|
5
|
|
|
5
|
1
|
8
|
my $self = shift; |
94
|
5
|
100
|
|
|
|
161
|
if (defined($self->upper)) { |
95
|
4
|
|
|
|
|
118
|
return 'range ' .$self->lower->addr .' ' .$self->upper->addr .';'; |
96
|
|
|
|
|
|
|
} else { |
97
|
1
|
|
|
|
|
32
|
return 'range ' .$self->lower->addr.';'; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd>. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |
108
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
109
|
|
|
|
|
|
|
1; |