| 1 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | package Net::NBName::NodeStatus::RR; | ||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use vars '$VERSION'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | $VERSION = "0.26"; | |||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use vars '@nodetypes'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | @nodetypes = qw/B-node P-node M-node H-node/; | |||||||||
| 11 | |||||||||||
| 12 | sub new | ||||||||||
| 13 | 10 | ▶ | { | ||||||||
|
Subroutine
new: called CC=6 SCAR=18.1
Pod
undocumented
| |||||||||||
| 14 | 10 | my $class = shift; | |||||||||
| 15 | 10 | my $rr_data = shift; | |||||||||
| 16 | 10 | my ($name, $suffix, $flags) = unpack("a15Cn", $rr_data); | |||||||||
| 17 | 10 | $name =~ tr/\x00-\x19/\./; # replace ctrl chars with "." | |||||||||
| 18 | 10 | $name =~ s/\s+//g; | |||||||||
| 19 | |||||||||||
| 20 | 10 | my $self = {}; | |||||||||
| 21 | 10 | $self->{'name'} = $name; | |||||||||
| 22 | 10 | $self->{'suffix'} = $suffix; | |||||||||
| 23 | 10 | ▶ | $self->{'G'} = ($flags & 2**15) ? "GROUP" : "UNIQUE"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 10 | $self->{'ONT'} = $nodetypes[($flags >> 13) & 3]; | |||||||||
| 25 | 10 | ▶ | $self->{'DRG'} = ($flags & 2**12) ? "Deregistering" : "Registered"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 10 | ▶ | $self->{'CNF'} = ($flags & 2**11) ? "Conflict" : ""; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 10 | ▶ | $self->{'ACT'} = ($flags & 2**10) ? "Active" : "Inactive"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 10 | ▶ | $self->{'PRM'} = ($flags & 2**9) ? "Permanent" : ""; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 10 | bless $self, $class; | |||||||||
| 31 | 10 | return $self; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | sub as_string | ||||||||||
| 35 | 0 | ▶ | { | ||||||||
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 36 | 0 | my $self = shift; | |||||||||
| 37 | |||||||||||
| 38 | return sprintf "%-15s<%02X> %-6s %-6s %-10s %-8s %-8s %-4s\n", | ||||||||||
| 39 | $self->{'name'}, | ||||||||||
| 40 | $self->{'suffix'}, | ||||||||||
| 41 | $self->{'G'}, | ||||||||||
| 42 | $self->{'ONT'}, | ||||||||||
| 43 | $self->{'DRG'}, | ||||||||||
| 44 | $self->{'ACT'}, | ||||||||||
| 45 | $self->{'CNF'}, | ||||||||||
| 46 | 0 | $self->{'PRM'}; | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 10 | ▶ | sub name { return $_[0]->{'name'}; } | ||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 50 | 0 | ▶ | sub suffix { return $_[0]->{'suffix'}; } | ||||||||
|
Subroutine
suffix: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 51 | 0 | ▶ | sub G { return $_[0]->{'G'}; } | ||||||||
|
Subroutine
G: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 52 | 0 | ▶ | sub ONT { return $_[0]->{'ONT'}; } | ||||||||
|
Subroutine
ONT: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 53 | 0 | ▶ | sub DRG { return $_[0]->{'DRG'}; } | ||||||||
|
Subroutine
DRG: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 54 | 0 | ▶ | sub ACT { return $_[0]->{'ACT'}; } | ||||||||
|
Subroutine
ACT: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 55 | 0 | ▶ | sub CNF { return $_[0]->{'CNF'}; } | ||||||||
|
Subroutine
CNF: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 56 | 0 | ▶ | sub PRM { return $_[0]->{'PRM'}; } | ||||||||
|
Subroutine
PRM: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 57 | |||||||||||
| 58 | 2 | 1; | |||||||||
| 59 | |||||||||||
| 60 | __END__ | ||||||||||