line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ISC::DHCPd::Config::Function; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Function - Function config parameters |
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
|
|
|
|
|
|
|
on $name_attribute_value { |
15
|
|
|
|
|
|
|
$body_attribute_value |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config/SYNOPSIS>. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
24
|
|
|
24
|
|
26761
|
use Moose; |
|
24
|
|
|
|
|
61
|
|
|
24
|
|
|
|
|
231
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# TODO: Should probably be a role instead... |
27
|
|
|
|
|
|
|
extends 'Net::ISC::DHCPd::Config::Block'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 name |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This attribute holds a plain string, representing the name |
34
|
|
|
|
|
|
|
of the function. Example: "commit". |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 body |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
The body text of the function, without trailing newline at end. |
39
|
|
|
|
|
|
|
The function body is not parsed, so the containing text can be |
40
|
|
|
|
|
|
|
anything. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 regex |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/regex>. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
83
|
|
|
83
|
1
|
662
|
sub regex { qr{^\s* on \s+ (\w+)}x } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 METHODS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 append_body |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Should probably be deprecated. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 prepend_body |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Should probably be deprecated. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 body_length |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Should probably be deprecated. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
1
|
0
|
sub append_body { push @{ shift->_body }, @_ } |
|
0
|
|
|
|
|
0
|
|
69
|
0
|
|
|
0
|
1
|
0
|
sub prepend_body { unshift @{ shift->_body }, @_ } |
|
0
|
|
|
|
|
0
|
|
70
|
0
|
|
|
0
|
1
|
0
|
sub body_length { length $_[0]->body } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 captured_to_args |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/captured_to_args>. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub captured_to_args { |
79
|
4
|
|
|
4
|
1
|
20
|
return { name => $_[0] } |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 generate |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/generate>. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub generate { |
89
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
return( |
92
|
1
|
|
|
|
|
38
|
'on ' .$self->name .' {', |
93
|
|
|
|
|
|
|
$self->body, |
94
|
|
|
|
|
|
|
'}', |
95
|
|
|
|
|
|
|
); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 AUTHOR |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd>. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
105
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
106
|
|
|
|
|
|
|
1; |