line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ISC::DHCPd::Config::Subnet6; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Subnet6 - Subnet6 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
|
|
|
|
|
|
|
subnet6 $address_attribute_value { |
15
|
|
|
|
|
|
|
$options_attribute_value |
16
|
|
|
|
|
|
|
$filename_attribute_value |
17
|
|
|
|
|
|
|
$range_attribute_value |
18
|
|
|
|
|
|
|
$pool_attribute_value |
19
|
|
|
|
|
|
|
$hosts_attribute_value |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config/SYNOPSIS>. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
24
|
|
|
24
|
|
27197
|
use Moose; |
|
24
|
|
|
|
|
64
|
|
|
24
|
|
|
|
|
217
|
|
29
|
24
|
|
|
24
|
|
163004
|
use NetAddr::IP qw(:lower); |
|
24
|
|
|
|
|
60
|
|
|
24
|
|
|
|
|
275
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
with 'Net::ISC::DHCPd::Config::Role'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 children |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/children>. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
sub children { |
39
|
28
|
|
|
28
|
1
|
300
|
return qw/ |
40
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Host |
41
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Pool |
42
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Range6 |
43
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Filename |
44
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Option |
45
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::KeyValue |
46
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Block |
47
|
|
|
|
|
|
|
/; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__PACKAGE__->create_children(__PACKAGE__->children()); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 options |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
A list of parsed L<Net::ISC::DHCPd::Config::Option> objects. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 ranges |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
A list of parsed L<Net::ISC::DHCPd::Config::Range> objects. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 hosts |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
A list of parsed L<Net::ISC::DHCPd::Config::Host> objects. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 filenames |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
A list of parsed L<Net::ISC::DHCPd::Config::Filename> objects. There can |
69
|
|
|
|
|
|
|
be only be one node in this list. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
before add_filename => sub { |
74
|
|
|
|
|
|
|
if(0 < int @{ $_[0]->filenames }) { |
75
|
|
|
|
|
|
|
confess 'Subnet6 cannot have more than one filename'; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
}; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 pools |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
A list of parsed L<Net::ISC::DHCPd::Config::Pool> objects. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 address |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This attribute holds an instance of L<NetAddr::IP>, and represents |
86
|
|
|
|
|
|
|
the ip address of this subnet. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
has address => ( |
91
|
|
|
|
|
|
|
is => 'ro', |
92
|
|
|
|
|
|
|
isa => 'NetAddr::IP', |
93
|
|
|
|
|
|
|
); |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 regex |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config/regex>. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
115
|
|
|
115
|
1
|
841
|
sub regex { qr{^ \s* subnet6 \s+ (\S+) }x } |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 METHODS |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 captured_to_args |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/captured_to_args>. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub captured_to_args { |
112
|
1
|
|
|
1
|
1
|
18
|
return { address => NetAddr::IP->new($_[0]) }; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head2 generate |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/generate>. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub generate { |
122
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
123
|
1
|
|
|
|
|
37
|
my $net = $self->address; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
return( |
126
|
1
|
|
|
|
|
13
|
'subnet6 ' .$net->short() .'/' . $net->masklen() . ' {', |
127
|
|
|
|
|
|
|
$self->_generate_config_from_children, |
128
|
|
|
|
|
|
|
'}', |
129
|
|
|
|
|
|
|
); |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 AUTHOR |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd>. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |
139
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
140
|
|
|
|
|
|
|
1; |