| 1 | # | ||||||||||
| 2 | # $Id: EmiteeDesc.pm 12 2015-01-14 06:29:59Z gomor $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Frame::Layer::LLTD::EmiteeDesc; | ||||||||||
| 5 | 10 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 10 | ▶ | use Net::Frame::Layer qw(:consts :subs); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 10 | our @ISA = qw(Net::Frame::Layer); | |||||||||
| 9 | |||||||||||
| 10 | 10 | our @AS = qw( | |||||||||
| 11 | type | ||||||||||
| 12 | pause | ||||||||||
| 13 | sourceAddress | ||||||||||
| 14 | destinationAddress | ||||||||||
| 15 | ); | ||||||||||
| 16 | 10 | __PACKAGE__->cgBuildIndices; | |||||||||
| 17 | 10 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 18 | |||||||||||
| 19 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 20 | shift->SUPER::new( | ||||||||||
| 21 | 1 | type => 0, | |||||||||
| 22 | pause => 0, | ||||||||||
| 23 | sourceAddress => 'ff:ff:ff:ff:ff:ff', | ||||||||||
| 24 | destinationAddress => 'ff:ff:ff:ff:ff:ff', | ||||||||||
| 25 | @_, | ||||||||||
| 26 | ); | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub getLength { 14 } | ||||||||
|
Subroutine
getLength: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | |||||||||||
| 31 | 1 | ▶ | sub pack { | ||||||||
|
Subroutine
pack: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 32 | 1 | my $self = shift; | |||||||||
| 33 | |||||||||||
| 34 | 1 | (my $sourceAddress = $self->sourceAddress) =~ s/://g; | |||||||||
| 35 | 1 | (my $destinationAddress = $self->destinationAddress) =~ s/://g; | |||||||||
| 36 | |||||||||||
| 37 | 1 | ▶ | $self->raw($self->SUPER::pack('CCH12H12', | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | $self->type, $self->pause, $sourceAddress, $destinationAddress, | ||||||||||
| 39 | )) or return undef; | ||||||||||
| 40 | |||||||||||
| 41 | 1 | $self->raw; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 1 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 45 | 1 | my $self = shift; | |||||||||
| 46 | |||||||||||
| 47 | 1 | ▶ | my ($type, $pause, $src, $dst, $payload) = | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | $self->SUPER::unpack('CCH12H12 a*', $self->raw) | ||||||||||
| 49 | or return undef; | ||||||||||
| 50 | |||||||||||
| 51 | 1 | $self->type($type); | |||||||||
| 52 | 1 | $self->pause($pause); | |||||||||
| 53 | 1 | $self->sourceAddress(convertMac($src)); | |||||||||
| 54 | 1 | $self->destinationAddress(convertMac($dst)); | |||||||||
| 55 | |||||||||||
| 56 | 1 | $self->payload($payload); | |||||||||
| 57 | |||||||||||
| 58 | 1 | $self; | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 0 | ▶ | sub print { | ||||||||
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 62 | 0 | my $self = shift; | |||||||||
| 63 | |||||||||||
| 64 | 0 | my $l = $self->layer; | |||||||||
| 65 | 0 | sprintf | |||||||||
| 66 | "$l: type:%02x pause:%02x\n". | ||||||||||
| 67 | "$l: sourceAddress: %s\n". | ||||||||||
| 68 | "$l: destinationAddress: %s", | ||||||||||
| 69 | $self->type, | ||||||||||
| 70 | $self->pause, | ||||||||||
| 71 | $self->sourceAddress, | ||||||||||
| 72 | $self->destinationAddress; | ||||||||||
| 73 | } | ||||||||||
| 74 | |||||||||||
| 75 | 10 | 1; | |||||||||
| 76 | |||||||||||
| 77 | __END__ | ||||||||||