line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
235603
|
use strict;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
100
|
|
2
|
2
|
|
|
2
|
|
11
|
use warnings;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
91
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Net::NBName::NodeStatus;
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1332
|
use Net::NBName::NodeStatus::RR;
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
193
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
14
|
use vars '$VERSION';
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
858
|
|
9
|
|
|
|
|
|
|
$VERSION = "0.26";
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new
|
12
|
|
|
|
|
|
|
{
|
13
|
2
|
|
|
2
|
0
|
445
|
my $class = shift;
|
14
|
2
|
|
|
|
|
5
|
my $resp = shift;
|
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
5
|
my @rr = ();
|
17
|
2
|
|
|
|
|
3
|
my $mac_address = "";
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Don't attempt to extract any names or the mac address
|
20
|
|
|
|
|
|
|
# if the response is truncated
|
21
|
2
|
100
|
|
|
|
9
|
if (length($resp) > 56) {
|
22
|
1
|
|
|
|
|
4
|
my $num_names = unpack("C", substr($resp, 56));
|
23
|
1
|
|
|
|
|
4
|
my $name_data = substr($resp, 57);
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
5
|
for (my $i = 0; $i < $num_names; $i++) {
|
26
|
10
|
|
|
|
|
16
|
my $rr_data = substr($name_data, 18*$i, 18);
|
27
|
10
|
|
|
|
|
39
|
push @rr, Net::NBName::NodeStatus::RR->new($rr_data);
|
28
|
|
|
|
|
|
|
}
|
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
5
|
$mac_address = join "-", map { sprintf "%02X", $_ }
|
|
6
|
|
|
|
|
20
|
|
31
|
|
|
|
|
|
|
unpack("C*", substr($name_data, 18 * $num_names, 6));
|
32
|
|
|
|
|
|
|
}
|
33
|
|
|
|
|
|
|
|
34
|
2
|
|
|
|
|
10
|
my $self = {'names' => \@rr, 'mac_address' => $mac_address};
|
35
|
2
|
|
|
|
|
6
|
bless $self, $class;
|
36
|
2
|
|
|
|
|
6
|
return $self;
|
37
|
|
|
|
|
|
|
}
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub as_string
|
40
|
|
|
|
|
|
|
{
|
41
|
0
|
|
|
0
|
1
|
0
|
my $self = shift;
|
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
0
|
my $string = "";
|
44
|
0
|
|
|
|
|
0
|
for my $rr (@{$self->{names}}) {
|
|
0
|
|
|
|
|
0
|
|
45
|
0
|
|
|
|
|
0
|
$string .= $rr->as_string;
|
46
|
|
|
|
|
|
|
}
|
47
|
0
|
|
|
|
|
0
|
$string .= "MAC Address = " . $self->{mac_address} . "\n";
|
48
|
0
|
|
|
|
|
0
|
return $string;
|
49
|
|
|
|
|
|
|
}
|
50
|
|
|
|
|
|
|
|
51
|
2
|
|
|
2
|
1
|
104
|
sub names { return @{$_[0]->{'names'}}; }
|
|
2
|
|
|
|
|
11
|
|
52
|
2
|
|
|
2
|
1
|
11
|
sub mac_address { return $_[0]->{'mac_address'}; }
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1;
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__
|