/usr/share/perl5/Net/Frame/Layer/ICMPv6/TooBig.pm is in libnet-frame-layer-icmpv6-perl 1.09-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | #
# Contributed by Vince http://www.vinsworld.com/
#
# $Id: TooBig.pm 45 2014-04-09 06:32:08Z gomor $
#
package Net::Frame::Layer::ICMPv6::TooBig;
use strict; use warnings;
use Net::Frame::Layer qw(:consts);
our @ISA = qw(Net::Frame::Layer);
our @AS = qw(
mtu
);
__PACKAGE__->cgBuildIndices;
__PACKAGE__->cgBuildAccessorsScalar(\@AS);
sub new {
my $self = shift->SUPER::new(
mtu => 0,
@_,
);
return $self;
}
sub getLength { 4 }
sub pack {
my $self = shift;
$self->raw($self->SUPER::pack('N', $self->mtu))
or return;
return $self->raw;
}
sub unpack {
my $self = shift;
my ($mtu, $payload) = $self->SUPER::unpack('N a*', $self->raw)
or return undef;
$self->mtu($mtu);
$self->payload($payload);
return $self;
}
sub encapsulate {
my $self = shift;
return $self->nextLayer if $self->nextLayer;
if ($self->payload) {
my $pLen = length($self->payload);
if ($pLen < 40) {
$self->payload($self->payload.("\x00" x (40 - $pLen)));
} elsif ($pLen > 1240) {
$self->payload(substr $self->payload, 0, 1240);
}
return 'IPv6';
}
return NF_LAYER_NONE;
}
sub print {
my $self = shift;
my $l = $self->layer;
return sprintf "$l: mtu:%d", $self->mtu;
}
1;
__END__
=head1 NAME
Net::Frame::Layer::ICMPv6::TooBig - ICMPv6 TooBig type object
=head1 SYNOPSIS
use Net::Frame::Layer::ICMPv6::TooBig;
my $layer = Net::Frame::Layer::ICMPv6::TooBig->new(
mtu => 0,
payload => '',
);
$layer->pack;
print 'RAW: '.$layer->dump."\n";
# Read a raw layer
my $layer = Net::Frame::Layer::ICMPv6::TooBig->new(raw => $raw);
print $layer->print."\n";
print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
if $layer->payload;
=head1 DESCRIPTION
This modules implements the encoding and decoding of the ICMPv6 TooBig object.
See also B<Net::Frame::Layer> for other attributes and methods.
=head1 ATTRIBUTES
=over 4
=item B<mtu>
Maximum Transmission Unit of the next-hop link.
=back
The following are inherited attributes. See B<Net::Frame::Layer> for more information.
=over 4
=item B<raw>
=item B<payload>
=item B<nextLayer>
=back
=head1 METHODS
=over 4
=item B<new>
=item B<new> (hash)
Object constructor. You can pass attributes that will overwrite default ones. See B<SYNOPSIS> for default values.
=back
The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See B<Net::Frame::Layer> for more information.
=over 4
=item B<layer>
=item B<computeLengths>
=item B<computeChecksums>
=item B<pack>
=item B<unpack>
=item B<encapsulate>
=item B<getLength>
=item B<getPayloadLength>
=item B<print>
=item B<dump>
=back
=head1 CONSTANTS
No constants here.
=head1 SEE ALSO
L<Net::Frame::Layer::ICMPv6>, L<Net::Frame::Layer>
=head1 AUTHOR
Patrice E<lt>GomoRE<gt> Auffret
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2006-2014, Patrice E<lt>GomoRE<gt> Auffret
You may distribute this module under the terms of the Artistic license.
See LICENSE.Artistic file in the source distribution archive.
=cut
|