line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ISC::DHCPd::Config::SharedNetwork; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::SharedNetwork - Shared-network 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 one of the |
13
|
|
|
|
|
|
|
blocks below, dependent on L</name> is set or not. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
shared-network $name_attribute_value { |
16
|
|
|
|
|
|
|
$keyvalues_attribute_value |
17
|
|
|
|
|
|
|
$subnets_attribute_value |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
shared-network { |
21
|
|
|
|
|
|
|
$keyvalues_attribute_value |
22
|
|
|
|
|
|
|
$subnets_attribute_value |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config/SYNOPSIS>. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
24
|
|
|
24
|
|
20024
|
use Moose; |
|
24
|
|
|
|
|
61
|
|
|
24
|
|
|
|
|
232
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
with 'Net::ISC::DHCPd::Config::Role'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 children |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/children>. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
sub children { |
41
|
38
|
|
|
38
|
1
|
303
|
return qw/ |
42
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Subnet |
43
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Subnet6 |
44
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::KeyValue |
45
|
|
|
|
|
|
|
/; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
__PACKAGE__->create_children(__PACKAGE__->children()); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 subnets |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
A list of parsed L<Net::ISC::DHCPd::Config::Subnet> objects. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 keyvalues |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
A list of parsed L<Net::ISC::DHCPd::Config::KeyValue> objects. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 name |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Holds a string representing the name of this shared network. |
62
|
|
|
|
|
|
|
Will be omitted if it contains an empty string. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
has name => ( |
67
|
|
|
|
|
|
|
is => 'ro', |
68
|
|
|
|
|
|
|
isa => 'Str', |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 quoted |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This flag tells if the shared-network name should be quoted or not. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
has quoted => ( |
78
|
|
|
|
|
|
|
is => 'ro', |
79
|
|
|
|
|
|
|
isa => 'Bool', |
80
|
|
|
|
|
|
|
); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 regex |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/regex>. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
109
|
|
|
109
|
1
|
783
|
sub regex { qr{^\s* shared-network \s+ ([\w-]+|".*?")? }x } |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 METHODS |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 captured_to_args |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/captured_to_args>. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub captured_to_args { |
99
|
8
|
|
|
8
|
1
|
17
|
my $name = shift; |
100
|
8
|
|
|
|
|
15
|
my $quoted = 0; |
101
|
8
|
100
|
|
|
|
30
|
return if !defined($name); |
102
|
|
|
|
|
|
|
|
103
|
5
|
100
|
|
|
|
28
|
$quoted = 1 if ($name =~ s/^"(.*)"$/$1/g); |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
return { |
106
|
5
|
|
|
|
|
22
|
name => $name, |
107
|
|
|
|
|
|
|
quoted => $quoted, |
108
|
|
|
|
|
|
|
}; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 generate |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/generate>. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub generate { |
119
|
4
|
|
|
4
|
1
|
8
|
my $self = shift; |
120
|
|
|
|
|
|
|
|
121
|
4
|
100
|
|
|
|
181
|
if (defined($self->name)) { |
122
|
3
|
|
|
|
|
138
|
my $name = $self->name; |
123
|
3
|
100
|
|
|
|
199
|
return 'shared-network ' . ($self->quoted ? qq("$name") : $self->name) . ' {', $self->_generate_config_from_children, '}'; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
1
|
|
|
|
|
5
|
return 'shared-network {', $self->_generate_config_from_children, '}'; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 AUTHOR |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd>. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=cut |
136
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
137
|
|
|
|
|
|
|
1; |