| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::ISC::DHCPd::Config::Host::HardwareEthernet; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Host::HardwareEthernet - Misc option 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
|
|
|
|
|
|
|
lines below |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
hardware ethernet $value_attribute_value; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config/SYNOPSIS>. |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
|
22
|
|
|
|
|
|
|
|
|
23
|
25
|
|
|
25
|
|
18524
|
use Moose; |
|
|
25
|
|
|
|
|
46
|
|
|
|
25
|
|
|
|
|
191
|
|
|
24
|
25
|
|
|
25
|
|
153352
|
use Net::ISC::DHCPd::Types 'Mac'; |
|
|
25
|
|
|
|
|
78
|
|
|
|
25
|
|
|
|
|
243
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
with 'Net::ISC::DHCPd::Config::Role'; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# not sure how I feel about the overload. I would rather coerce the values |
|
29
|
|
|
|
|
|
|
# into a Mac type, but I want case preserved from input to output. I only |
|
30
|
|
|
|
|
|
|
# want comparisions to be insensitive. |
|
31
|
|
|
|
|
|
|
|
|
32
|
25
|
|
|
|
|
269
|
use overload '==' => \&myequals, |
|
33
|
|
|
|
|
|
|
'eq' => \&myequals, |
|
34
|
25
|
|
|
25
|
|
76487
|
q("") => \&get_value; |
|
|
25
|
|
|
|
|
55
|
|
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 myequals |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
equality check overload for case insensitive comparision |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub myequals { |
|
45
|
0
|
|
|
0
|
1
|
0
|
return (uc($_[0]->value) eq uc($_[1])); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 get_value |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
for overload q("") |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
|
53
|
|
|
|
|
|
|
|
|
54
|
0
|
|
|
0
|
1
|
0
|
sub get_value { uc(shift->value) } |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 value |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Value of the option - See L</DESCRIPTION> for details. |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
has value => ( |
|
63
|
|
|
|
|
|
|
is => 'ro', |
|
64
|
|
|
|
|
|
|
isa => Mac, |
|
65
|
|
|
|
|
|
|
coerce => 1, |
|
66
|
|
|
|
|
|
|
); |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 regex |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/regex>. |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
our $regex = qr{^\s* hardware \s+ ethernet \s+ (.*) ;}x; |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 METHODS |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 captured_to_args |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/captured_to_args>. |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub captured_to_args { |
|
85
|
10
|
|
|
10
|
1
|
17
|
my $value = shift; |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
return { |
|
88
|
10
|
|
|
|
|
28
|
value => $value, |
|
89
|
|
|
|
|
|
|
}; |
|
90
|
|
|
|
|
|
|
} |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 generate |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/generate>. |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub generate { |
|
99
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
|
100
|
2
|
|
|
|
|
62
|
return sprintf qq(hardware ethernet %s;), $self->value; |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 AUTHOR |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd>. |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
|
110
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
111
|
|
|
|
|
|
|
1; |