line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: IPv6.pm 2234 2014-04-08 13:05:14Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::SinFP3::Ext::IP::IPv6; |
5
|
1
|
|
|
1
|
|
654
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
6
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use base qw(Net::SinFP3::Ext::IP); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
170
|
|
9
|
|
|
|
|
|
|
our @AS = qw( |
10
|
|
|
|
|
|
|
global |
11
|
|
|
|
|
|
|
next |
12
|
|
|
|
|
|
|
_tcp |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
8
|
use Net::Frame::Layer::ETH qw(:consts); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
297
|
|
18
|
1
|
|
|
1
|
|
775
|
use Net::Frame::Layer::IPv6 qw(:consts); |
|
1
|
|
|
|
|
5175
|
|
|
1
|
|
|
|
|
467
|
|
19
|
1
|
|
|
1
|
|
11
|
use Net::Frame::Layer::TCP qw(:consts); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
732
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub getResponseIpTtl { |
22
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
23
|
0
|
|
|
|
|
|
my ($response) = @_; |
24
|
0
|
|
|
|
|
|
return $response->reply->ref->{IPv6}->hopLimit; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub getResponseIpId { |
28
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
29
|
0
|
|
|
|
|
|
my ($response) = @_; |
30
|
0
|
|
|
|
|
|
return $response->reply->ref->{IPv6}->flowLabel; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub getResponseIpDfBit { |
34
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
35
|
0
|
|
|
|
|
|
my ($response) = @_; |
36
|
0
|
|
|
|
|
|
return $response->reply->ref->{IPv6}->trafficClass; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub getProbeIpId { |
40
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
41
|
0
|
|
|
|
|
|
my ($response) = @_; |
42
|
0
|
|
|
|
|
|
return $response->ref->{IPv6}->flowLabel; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _getEthHeader { |
46
|
0
|
|
|
0
|
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
return Net::Frame::Layer::ETH->new( |
48
|
|
|
|
|
|
|
type => NF_ETH_TYPE_IPv6, |
49
|
|
|
|
|
|
|
src => $self->global->mac, |
50
|
|
|
|
|
|
|
dst => $self->next->mac, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _getIpv6Header { |
55
|
0
|
|
|
0
|
|
|
my $self = shift; |
56
|
0
|
|
|
|
|
|
return Net::Frame::Layer::IPv6->new( |
57
|
|
|
|
|
|
|
version => 6, |
58
|
|
|
|
|
|
|
trafficClass => 0, |
59
|
|
|
|
|
|
|
flowLabel => 0, |
60
|
|
|
|
|
|
|
nextHeader => NF_IPv6_PROTOCOL_TCP, |
61
|
|
|
|
|
|
|
hopLimit => 0xff, |
62
|
|
|
|
|
|
|
src => $self->global->ip6, |
63
|
|
|
|
|
|
|
dst => $self->next->ip, |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub getP1 { |
68
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
my $eth = $self->_getEthHeader; |
71
|
0
|
|
|
|
|
|
my $ip6 = $self->_getIpv6Header; |
72
|
0
|
|
|
|
|
|
my $tcp = $self->_tcp->_getP1Tcp; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return Net::Frame::Simple->new(layers => [ $eth, $ip6, $tcp, ]); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub getP2 { |
78
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
my $eth = $self->_getEthHeader; |
81
|
0
|
|
|
|
|
|
my $ip6 = $self->_getIpv6Header; |
82
|
0
|
|
|
|
|
|
my $tcp = $self->_tcp->_getP2Tcp; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return Net::Frame::Simple->new(layers => [ $eth, $ip6, $tcp, ]); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub getP3 { |
88
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
|
my $eth = $self->_getEthHeader; |
91
|
0
|
|
|
|
|
|
my $ip6 = $self->_getIpv6Header; |
92
|
0
|
|
|
|
|
|
my $tcp = $self->_tcp->_getP3Tcp; |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
return Net::Frame::Simple->new(layers => [ $eth, $ip6, $tcp, ]); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |