| 1 | #!/bin/false | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # PODNAME: Net::DHCP::Packet::OrderOptions | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Option ordering quirks for Net::DHCP | ||||||||||||||||||||||||||||||||||||||||||
| 4 | 14 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 14 | ▶ | use warnings FATAL => 'uninitialized'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 14 | ▶ | use 5.8.0; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | package Net::DHCP::Packet::OrderOptions; | ||||||||||||||||||||||||||||||||||||||||||
| 9 | 14 | $Net::DHCP::Packet::OrderOptions::VERSION = '0.8'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | 14 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 14 | our @EXPORT_OK = qw( reorder_options ); | |||||||||||||||||||||||||||||||||||||||||
| 12 | 14 | our %EXPORT_TAGS = ( all => \@EXPORT_OK ); | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | #======================================================================= | ||||||||||||||||||||||||||||||||||||||||||
| 15 | sub reorder_options { | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 19 | ▶ | my @codes = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reorder_options: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | # Quirk: Intel PXE wants option 60 before option 43 | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 19 | my ( $i60, $i43 ); | |||||||||||||||||||||||||||||||||||||||||
| 20 | 19 | ▶ | for ( my $i = 0; $i < @codes; $i++ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 36 | ▶ | $i60 = $i if $codes[$i] == 60; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 36 | ▶ | $i43 = $i if $codes[$i] == 43; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 19 | ▶ | if ( defined $i60 && defined $i43 && $i60 > $i43 ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
defined $i60 and defined $i43 and $i60 > $i43
defined $i60 and defined $i43
MC/DC100%3/3
defined $i60 and defined $i43 and $i60 > $i43
defined $i60
defined $i43
$i60 > $i43
Truth table100%4/4
A and B and C
A= defined $i60B= defined $i43C= $i60 > $i43
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 2 | @codes[ $i60, $i43 ] = @codes[ $i43, $i60 ]; | |||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | # Quirk: Cablelabs want option 82 at the very end | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 19 | my @no82 = grep { $_ != 82 } @codes; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 19 | ▶ | @codes = ( @no82, 82 ) if @no82 != @codes; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | return @codes | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 19 | } | |||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | #======================================================================= | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 14 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||||||||||||||||||||||||