| 1 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # $Id: ICMPv6.pm,v bc01789674fd 2019/05/23 05:51:45 gomor $ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | package Net::Frame::Layer::ICMPv6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use strict; use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | our $VERSION = '1.11'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 3 | ▶ | use Net::Frame::Layer qw(:consts :subs); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use Exporter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 3 | our @ISA = qw(Net::Frame::Layer Exporter); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 3 | our %EXPORT_TAGS = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | consts => [qw( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | NF_ICMPv6_CODE_ZERO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | NF_ICMPv6_TYPE_DESTUNREACH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | NF_ICMPv6_CODE_NOROUTE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | NF_ICMPv6_CODE_ADMINPROHIBITED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | NF_ICMPv6_CODE_NOTASSIGNED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | NF_ICMPv6_CODE_ADDRESSUNREACH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | NF_ICMPv6_CODE_PORTUNREACH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | NF_ICMPv6_CODE_FAILPOLICY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | NF_ICMPv6_CODE_REJECTROUTE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | NF_ICMPv6_TYPE_TOOBIG | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | NF_ICMPv6_TYPE_TIMEEXCEED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | NF_ICMPv6_CODE_HOPLIMITEXCEED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | NF_ICMPv6_CODE_FRAGREASSEMBLYEXCEEDED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | NF_ICMPv6_TYPE_PARAMETERPROBLEM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | NF_ICMPv6_CODE_ERRONEOUSHERDERFIELD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | NF_ICMPv6_CODE_UNKNOWNNEXTHEADER | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | NF_ICMPv6_CODE_UNKNOWNOPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | NF_ICMPv6_TYPE_ECHO_REQUEST | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | NF_ICMPv6_TYPE_ECHO_REPLY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | NF_ICMPv6_TYPE_MLDQUERY | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | NF_ICMPv6_TYPE_MLDREPORTv1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | NF_ICMPv6_TYPE_MLDDONE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | NF_ICMPv6_TYPE_ROUTERSOLICITATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | NF_ICMPv6_TYPE_ROUTERADVERTISEMENT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | NF_ICMPv6_TYPE_NEIGHBORSOLICITATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | NF_ICMPv6_TYPE_NEIGHBORADVERTISEMENT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | NF_ICMPv6_TYPE_MLDREPORTv2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | NF_ICMPv6_OPTION_SOURCELINKLAYERADDRESS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | NF_ICMPv6_OPTION_TARGETLINKLAYERADDRESS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | NF_ICMPv6_OPTION_PREFIXINFORMATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | NF_ICMPv6_OPTION_REDIRECTEDHEADER | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | NF_ICMPv6_OPTION_MTU | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | NF_ICMPv6_FLAG_ROUTER | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | NF_ICMPv6_FLAG_SOLICITED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | NF_ICMPv6_FLAG_OVERRIDE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | NF_ICMPv6_FLAG_MANAGEDADDRESSCONFIGURATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | NF_ICMPv6_FLAG_OTHERCONFIGURATION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | our @EXPORT_OK = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 3 | @{$EXPORT_TAGS{consts}}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 3 | ▶ | use constant NF_ICMPv6_CODE_ZERO => 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 3 | ▶ | use constant NF_ICMPv6_TYPE_DESTUNREACH => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 3 | ▶ | use constant NF_ICMPv6_CODE_NOROUTE => 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 3 | ▶ | use constant NF_ICMPv6_CODE_ADMINPROHIBITED => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 3 | ▶ | use constant NF_ICMPv6_CODE_NOTASSIGNED => 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 3 | ▶ | use constant NF_ICMPv6_CODE_ADDRESSUNREACH => 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 3 | ▶ | use constant NF_ICMPv6_CODE_PORTUNREACH => 4; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 3 | ▶ | use constant NF_ICMPv6_CODE_FAILPOLICY => 5; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 3 | ▶ | use constant NF_ICMPv6_CODE_REJECTROUTE => 6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 3 | ▶ | use constant NF_ICMPv6_TYPE_TOOBIG => 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 3 | ▶ | use constant NF_ICMPv6_TYPE_TIMEEXCEED => 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 3 | ▶ | use constant NF_ICMPv6_CODE_HOPLIMITEXCEED => 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 3 | ▶ | use constant NF_ICMPv6_CODE_FRAGREASSEMBLYEXCEEDED => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 3 | ▶ | use constant NF_ICMPv6_TYPE_PARAMETERPROBLEM => 4; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 3 | ▶ | use constant NF_ICMPv6_CODE_ERRONEOUSHERDERFIELD => 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 3 | ▶ | use constant NF_ICMPv6_CODE_UNKNOWNNEXTHEADER => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 3 | ▶ | use constant NF_ICMPv6_CODE_UNKNOWNOPTION => 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 3 | ▶ | use constant NF_ICMPv6_TYPE_ECHO_REQUEST => 128; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 3 | ▶ | use constant NF_ICMPv6_TYPE_ECHO_REPLY => 129; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 3 | ▶ | use constant NF_ICMPv6_TYPE_MLDQUERY => 130; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 3 | ▶ | use constant NF_ICMPv6_TYPE_MLDREPORTv1 => 131; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 3 | ▶ | use constant NF_ICMPv6_TYPE_MLDDONE => 132; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 3 | ▶ | use constant NF_ICMPv6_TYPE_ROUTERSOLICITATION => 133; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 3 | ▶ | use constant NF_ICMPv6_TYPE_ROUTERADVERTISEMENT => 134; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 3 | ▶ | use constant NF_ICMPv6_TYPE_NEIGHBORSOLICITATION => 135; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 3 | ▶ | use constant NF_ICMPv6_TYPE_NEIGHBORADVERTISEMENT => 136; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 3 | ▶ | use constant NF_ICMPv6_TYPE_MLDREPORTv2 => 143; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 3 | ▶ | use constant NF_ICMPv6_OPTION_SOURCELINKLAYERADDRESS => 0x01; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 3 | ▶ | use constant NF_ICMPv6_OPTION_TARGETLINKLAYERADDRESS => 0x02; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 3 | ▶ | use constant NF_ICMPv6_OPTION_PREFIXINFORMATION => 0x03; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 3 | ▶ | use constant NF_ICMPv6_OPTION_REDIRECTEDHEADER => 0x04; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 3 | ▶ | use constant NF_ICMPv6_OPTION_MTU => 0x05; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 3 | ▶ | use constant NF_ICMPv6_FLAG_ROUTER => 0x04; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 3 | ▶ | use constant NF_ICMPv6_FLAG_SOLICITED => 0x02; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 3 | ▶ | use constant NF_ICMPv6_FLAG_OVERRIDE => 0x01; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 3 | ▶ | use constant NF_ICMPv6_FLAG_MANAGEDADDRESSCONFIGURATION => 1 << 5; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 3 | ▶ | use constant NF_ICMPv6_FLAG_OTHERCONFIGURATION => 1 << 4; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 3 | ▶ | use constant NF_ICMPv6_FLAG_MOBILEIPv6HOMEAGENT => 1 << 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 3 | ▶ | use constant NF_ICMPv6_FLAG_ROUTERSELECTIONPREFHIGH => 1 << 1; # 01b | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 3 | ▶ | use constant NF_ICMPv6_FLAG_ROUTERSELECTIONPREFMEDIUM => 0; # 00b | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 3 | ▶ | use constant NF_ICMPv6_FLAG_ROUTERSELECTIONPREFLOW => 3 << 1; # 11b | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 3 | ▶ | use constant NF_ICMPv6_FLAG_ROUTERSELECTIONPREFRESERVED => 2 << 1; # 10b | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 3 | ▶ | use constant NF_ICMPv6_FLAG_NEIGHBORDISCOVERYPROXY => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 3 | our @AS = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | checksum | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 3 | __PACKAGE__->cgBuildIndices; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 3 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 3 | ▶ | use Bit::Vector; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | shift->SUPER::new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 1 | type => NF_ICMPv6_TYPE_ECHO_REQUEST, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | code => NF_ICMPv6_CODE_ZERO, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | checksum => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | @_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | # XXX: may be better, by keying on type also | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | sub getKey { shift->layer } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getKey: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub getKeyReverse { shift->layer } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getKeyReverse: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | sub match { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
match: not called CC=10 SCAR=47.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | my ($with) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my $sType = $self->type; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | my $wType = $with->type; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | if ($sType eq NF_ICMPv6_TYPE_ECHO_REQUEST | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition0%0/3
$sType eq 128 and $wType eq 129
MC/DC0%0/2
$sType eq 128 and $wType eq 129
$sType eq 128
$wType eq 129
Truth table0%0/3
A and B
A= $sType eq 128B= $wType eq 129
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | && $wType eq NF_ICMPv6_TYPE_ECHO_REPLY) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | ▶ | elsif ($sType eq NF_ICMPv6_TYPE_NEIGHBORSOLICITATION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sType eq 135 and $wType eq 136
MC/DC0%0/2
$sType eq 135 and $wType eq 136
$sType eq 135
$wType eq 136
Truth table0%0/3
A and B
A= $sType eq 135B= $wType eq 136
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | && $wType eq NF_ICMPv6_TYPE_NEIGHBORADVERTISEMENT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | ▶ | elsif ($sType eq NF_ICMPv6_TYPE_ROUTERSOLICITATION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sType eq 133 and $wType eq 134
MC/DC0%0/2
$sType eq 133 and $wType eq 134
$sType eq 133
$wType eq 134
Truth table0%0/3
A and B
A= $sType eq 133B= $wType eq 134
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | && $wType eq NF_ICMPv6_TYPE_ROUTERADVERTISEMENT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | ▶ | elsif ($sType eq NF_ICMPv6_TYPE_MLDQUERY | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
$sType eq 130 and $wType eq 131 || $wType eq 143
$wType eq 131 or $wType eq 143
MC/DC0%0/3
$sType eq 130 and $wType eq 131 || $wType eq 143
$sType eq 130
$wType eq 131
$wType eq 143
Truth table0%0/4
A and B or C
A= $sType eq 130B= $wType eq 131C= $wType eq 143
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | && (($wType eq NF_ICMPv6_TYPE_MLDREPORTv1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | || ($wType eq NF_ICMPv6_TYPE_MLDREPORTv2)) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | sub getLength { 4 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getLength: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 1 | ▶ | sub pack { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pack: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 1 | ▶ | my $raw = $self->SUPER::pack('CCn', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | $self->type, $self->code, $self->checksum, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | ) or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 1 | return $self->raw($raw); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 1 | ▶ | sub unpack { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unpack: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 1 | ▶ | my ($type, $code, $checksum, $payload) = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | $self->SUPER::unpack('CCn a*', $self->raw) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 1 | $self->type($type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 1 | $self->code($code); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 1 | $self->checksum($checksum); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 1 | $self->payload($payload); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | sub computeChecksums { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
computeChecksums: not called CC=28 SCAR=67.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | my ($layers) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | my $ip; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | my $rh0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | my $hbh; # Hop-by-hop Ext Hdr | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | my $dst; # Destination Ext Hdr | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | my $mob; # Mobility Ext Hdr | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | my $lastNextHeader; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | my $fragmentFlag = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | my $start = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | my $last = $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | my $payload = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | for my $l (@$layers) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | if (! $ip && $l->layer eq 'IPv6') { $ip = $l; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $ip and $l->layer eq "IPv6"
MC/DC0%0/2
not $ip and $l->layer eq "IPv6"
not $ip
$l->layer eq "IPv6"
Truth table0%0/3
not(A) and B
A= not $ipB= $l->layer eq "IPv6"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | if (! $rh0 && $l->layer eq 'IPv6::Routing') { $rh0 = $l; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $rh0 and $l->layer eq "IPv6::Routing"
MC/DC0%0/2
not $rh0 and $l->layer eq "IPv6::Routing"
not $rh0
$l->layer eq "IPv6::Routing"
Truth table0%0/3
not(A) and B
A= not $rh0B= $l->layer eq "IPv6::Routing"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | if (! $hbh && $l->layer eq 'IPv6::HopByHop') { $hbh = $l; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $hbh and $l->layer eq "IPv6::HopByHop"
MC/DC0%0/2
not $hbh and $l->layer eq "IPv6::HopByHop"
not $hbh
$l->layer eq "IPv6::HopByHop"
Truth table0%0/3
not(A) and B
A= not $hbhB= $l->layer eq "IPv6::HopByHop"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | if (! $dst && $l->layer eq 'IPv6::Destination') { $dst = $l; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $dst and $l->layer eq "IPv6::Destination"
MC/DC0%0/2
not $dst and $l->layer eq "IPv6::Destination"
not $dst
$l->layer eq "IPv6::Destination"
Truth table0%0/3
not(A) and B
A= not $dstB= $l->layer eq "IPv6::Destination"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | if (! $mob && $l->layer eq 'IPv6::Mobility') { $mob = $l; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $mob and $l->layer eq "IPv6::Mobility"
MC/DC0%0/2
not $mob and $l->layer eq "IPv6::Mobility"
not $mob
$l->layer eq "IPv6::Mobility"
Truth table0%0/3
not(A) and B
A= not $mobB= $l->layer eq "IPv6::Mobility"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | if ($l->can('nextHeader')) { $lastNextHeader = $l->nextHeader; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | if ($l->layer eq 'IPv6::Fragment') { $fragmentFlag = 1; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | $last = $l; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | if (! $start) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | ▶ | $start++ if $l->layer eq 'ICMPv6'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | $payload .= $l->pack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | my $lastIpDst = $ip->dst; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | my $ipPayloadLength = $ip->payloadLength; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | # If RH0, need to set $ip->dst to last $rh0->addresses | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | # unless segmentsLeft == 0 (RFC 2460 sec 8.1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | if ($rh0 && $rh0->segmentsLeft != 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$rh0 and $rh0->segmentsLeft != 0
MC/DC0%0/2
$rh0 and $rh0->segmentsLeft != 0
$rh0
$rh0->segmentsLeft != 0
Truth table0%0/3
A and B
A= $rh0B= $rh0->segmentsLeft != 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | for ($rh0->addresses) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | $lastIpDst = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | # Pseudo header length is upper layer minus any EH (RFC 2460 sec 8.1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $ipPayloadLength -= $rh0->getLength; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | # Pseudo header length is upper layer minus any EH (RFC 2460 sec 8.1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | ▶ | if ($fragmentFlag) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | $ipPayloadLength -= 8; # 8 = length of fragment EH | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | ▶ | if ($hbh) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | $ipPayloadLength -= $hbh->getLength; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | if ($dst) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | $ipPayloadLength -= $dst->getLength; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | if ($mob) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | $ipPayloadLength -= $mob->getLength; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | # Build pseudo-header and pack ICMPv6 packet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | my $zero = Bit::Vector->new_Dec(24, 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | my $nextHeader = Bit::Vector->new_Dec( 8, $lastNextHeader); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | my $v32 = $zero->Concat_List($nextHeader); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | ▶ | my $packed = $self->SUPER::pack('a*a*NNCCn', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | inet6Aton($ip->src), inet6Aton($lastIpDst), $ipPayloadLength, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | $v32->to_Dec, $self->type, $self->code, 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | ) or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | if (defined($last->payload) && length($last->payload)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $last->payload and length $last->payload
MC/DC0%0/2
defined $last->payload and length $last->payload
defined $last->payload
length $last->payload
Truth table0%0/3
A and B
A= defined $last->payloadB= length $last->payload
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | $payload .= $last->payload; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | if (length($payload)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | $packed .= $self->SUPER::pack('a*', $payload) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | $self->checksum(inetChecksum($packed)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | sub encapsulate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
encapsulate: not called CC=17 SCAR=57.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | return $self->nextLayer if $self->nextLayer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | if ($self->payload) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | my $type = $self->type; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | # if ($type eq NF_ICMPv6_TYPE_REDIRECT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | # return 'IPv6'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | # } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | if ($type eq NF_ICMPv6_TYPE_ECHO_REQUEST | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 11 branches
Condition0%0/3
$type eq 128 or $type eq 129
MC/DC0%0/2
$type eq 128 or $type eq 129
$type eq 128
$type eq 129
Truth table0%0/3
A or B
A= $type eq 128B= $type eq 129
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | || $type eq NF_ICMPv6_TYPE_ECHO_REPLY) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | return 'ICMPv6::Echo'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | elsif ($type eq NF_ICMPv6_TYPE_NEIGHBORSOLICITATION) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | return 'ICMPv6::NeighborSolicitation'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | elsif ($type eq NF_ICMPv6_TYPE_NEIGHBORADVERTISEMENT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | return 'ICMPv6::NeighborAdvertisement'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | elsif ($type eq NF_ICMPv6_TYPE_ROUTERSOLICITATION) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | return 'ICMPv6::RouterSolicitation'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | elsif ($type eq NF_ICMPv6_TYPE_ROUTERADVERTISEMENT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | return 'ICMPv6::RouterAdvertisement'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | elsif ($type eq NF_ICMPv6_TYPE_DESTUNREACH) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | return 'ICMPv6::DestUnreach'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | elsif ($type eq NF_ICMPv6_TYPE_TIMEEXCEED) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | return 'ICMPv6::TimeExceed'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | elsif ($type eq NF_ICMPv6_TYPE_TOOBIG) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | return 'ICMPv6::TooBig'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | elsif ($type eq NF_ICMPv6_TYPE_PARAMETERPROBLEM) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | return 'ICMPv6::ParameterProblem'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | ▶ | elsif ($type eq NF_ICMPv6_TYPE_MLDQUERY | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
$type eq 130 or $type eq 131 or $type eq 132
$type eq 130 or $type eq 131
MC/DC0%0/3
$type eq 130 or $type eq 131 or $type eq 132
$type eq 130
$type eq 131
$type eq 132
Truth table0%0/4
A or B or C
A= $type eq 130B= $type eq 131C= $type eq 132
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | || $type eq NF_ICMPv6_TYPE_MLDREPORTv1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | || $type eq NF_ICMPv6_TYPE_MLDDONE) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | return 'ICMPv6::MLD'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | elsif ($type eq NF_ICMPv6_TYPE_MLDREPORTv2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | return 'ICMPv6::MLD::Report'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | return NF_LAYER_NONE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | ▶ | sub print { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | my $l = $self->layer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | my $buf = sprintf "$l: type:%d code:%d checksum:0x%04x", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | $self->type, $self->code, $self->checksum; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | return $buf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||