line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
18
|
use strict;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
75
|
|
2
|
2
|
|
|
2
|
|
11
|
use warnings;
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
91
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Net::NBName::NodeStatus::RR;
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use vars '$VERSION';
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
133
|
|
7
|
|
|
|
|
|
|
$VERSION = "0.26";
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
17
|
use vars '@nodetypes';
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1225
|
|
10
|
|
|
|
|
|
|
@nodetypes = qw/B-node P-node M-node H-node/;
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new
|
13
|
|
|
|
|
|
|
{
|
14
|
10
|
|
|
10
|
0
|
13
|
my $class = shift;
|
15
|
10
|
|
|
|
|
12
|
my $rr_data = shift;
|
16
|
10
|
|
|
|
|
50
|
my ($name, $suffix, $flags) = unpack("a15Cn", $rr_data);
|
17
|
10
|
|
|
|
|
17
|
$name =~ tr/\x00-\x19/\./; # replace ctrl chars with "."
|
18
|
10
|
|
|
|
|
29
|
$name =~ s/\s+//g;
|
19
|
|
|
|
|
|
|
|
20
|
10
|
|
|
|
|
16
|
my $self = {};
|
21
|
10
|
|
|
|
|
20
|
$self->{'name'} = $name;
|
22
|
10
|
|
|
|
|
14
|
$self->{'suffix'} = $suffix;
|
23
|
10
|
100
|
|
|
|
34
|
$self->{'G'} = ($flags & 2**15) ? "GROUP" : "UNIQUE";
|
24
|
10
|
|
|
|
|
21
|
$self->{'ONT'} = $nodetypes[($flags >> 13) & 3];
|
25
|
10
|
50
|
|
|
|
22
|
$self->{'DRG'} = ($flags & 2**12) ? "Deregistering" : "Registered";
|
26
|
10
|
50
|
|
|
|
22
|
$self->{'CNF'} = ($flags & 2**11) ? "Conflict" : "";
|
27
|
10
|
50
|
|
|
|
21
|
$self->{'ACT'} = ($flags & 2**10) ? "Active" : "Inactive";
|
28
|
10
|
50
|
|
|
|
30
|
$self->{'PRM'} = ($flags & 2**9) ? "Permanent" : "";
|
29
|
|
|
|
|
|
|
|
30
|
10
|
|
|
|
|
25
|
bless $self, $class;
|
31
|
10
|
|
|
|
|
50
|
return $self;
|
32
|
|
|
|
|
|
|
}
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub as_string
|
35
|
|
|
|
|
|
|
{
|
36
|
0
|
|
|
0
|
1
|
0
|
my $self = shift;
|
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
0
|
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
|
|
|
|
|
|
|
$self->{'PRM'};
|
47
|
|
|
|
|
|
|
}
|
48
|
|
|
|
|
|
|
|
49
|
10
|
|
|
10
|
1
|
49
|
sub name { return $_[0]->{'name'}; }
|
50
|
0
|
|
|
0
|
1
|
|
sub suffix { return $_[0]->{'suffix'}; }
|
51
|
0
|
|
|
0
|
1
|
|
sub G { return $_[0]->{'G'}; }
|
52
|
0
|
|
|
0
|
1
|
|
sub ONT { return $_[0]->{'ONT'}; }
|
53
|
0
|
|
|
0
|
1
|
|
sub DRG { return $_[0]->{'DRG'}; }
|
54
|
0
|
|
|
0
|
1
|
|
sub ACT { return $_[0]->{'ACT'}; }
|
55
|
0
|
|
|
0
|
1
|
|
sub CNF { return $_[0]->{'CNF'}; }
|
56
|
0
|
|
|
0
|
1
|
|
sub PRM { return $_[0]->{'PRM'}; }
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1;
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__
|