line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# FTN/Nodelist/Node.pm |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2005 Serguei Trouchelle. All rights reserved. |
4
|
|
|
|
|
|
|
# Copyright (c) 2013 Robert James Clay. All rights reserved. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify it |
7
|
|
|
|
|
|
|
# under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# History: |
10
|
|
|
|
|
|
|
# 1.08 2013/05/09 Move 'pm' files to the more standard locations under the |
11
|
|
|
|
|
|
|
# lib/ directory. Add Author & Copyright information for |
12
|
|
|
|
|
|
|
# Robert James Clay . Match version number |
13
|
|
|
|
|
|
|
# to that of main FTN::Nodelist module. |
14
|
|
|
|
|
|
|
# 1.02 2005/02/22 Documentation improved |
15
|
|
|
|
|
|
|
# 1.01 2005/02/16 Initial revision |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
FTN::Nodelist::Node - Manipulate node information in FTN nodelist |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $ndl = new FTN::Nodelist(-file => '/fido/var/ndl/nodelist.*'); |
24
|
|
|
|
|
|
|
if (my $node = $ndl->getNode('2:550/4077')) { |
25
|
|
|
|
|
|
|
print $node->sysop(); |
26
|
|
|
|
|
|
|
} else { |
27
|
|
|
|
|
|
|
warn 'Cannot find node'; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
C contains functions that can be used to get information |
33
|
|
|
|
|
|
|
about node entry in Fidonet Technology Network nodelist. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 METHODS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 new |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This method creates C object. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
You should not use it anyway, since it is used from C. |
42
|
|
|
|
|
|
|
See L for details. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
package FTN::Nodelist::Node; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
require Exporter; |
49
|
6
|
|
|
6
|
|
20
|
use Config; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
243
|
|
50
|
|
|
|
|
|
|
|
51
|
6
|
|
|
6
|
|
20
|
use strict; |
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
92
|
|
52
|
6
|
|
|
6
|
|
20
|
use warnings; |
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
2059
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
our @EXPORT_OK = qw//; |
55
|
|
|
|
|
|
|
our %EXPORT_TAGS = (); |
56
|
|
|
|
|
|
|
our @ISA = qw/Exporter/; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
$FTN::Nodelist::Node::VERSION = "1.08"; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub new { |
61
|
23
|
|
|
23
|
1
|
26
|
my $self = shift; |
62
|
23
|
|
|
|
|
18
|
my $addr = shift; # FTN::Address hash {z/n/f/p} |
63
|
23
|
|
|
|
|
18
|
my $line = shift; # Nodelist line |
64
|
|
|
|
|
|
|
|
65
|
23
|
|
|
|
|
78
|
$line =~ s/_/ /g; # change underline to spaces |
66
|
|
|
|
|
|
|
|
67
|
23
|
|
|
|
|
27
|
$self = $addr; |
68
|
|
|
|
|
|
|
$self->{'__addr'} = $addr->{'z'} . ':' . $addr->{'n'} . '/' . |
69
|
23
|
|
|
|
|
52
|
$addr->{'f'} . '.' . $addr->{'p'}; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
( |
72
|
|
|
|
|
|
|
$self->{'__keyword'}, # Pvt/Hold/Down/Zone/Region/Host/Hub |
73
|
|
|
|
|
|
|
undef, # Node Number |
74
|
|
|
|
|
|
|
$self->{'__name'}, # Node Name |
75
|
|
|
|
|
|
|
$self->{'__loc'}, # Location |
76
|
|
|
|
|
|
|
$self->{'__sysop'}, # Sysop Name |
77
|
|
|
|
|
|
|
$self->{'__phone'}, # Phone Number |
78
|
|
|
|
|
|
|
$self->{'__speed'}, # DCE Speed |
79
|
23
|
|
|
|
|
117
|
@{$self->{'__flags'}} |
|
23
|
|
|
|
|
94
|
|
80
|
|
|
|
|
|
|
) = split ',', $line; |
81
|
|
|
|
|
|
|
|
82
|
23
|
|
|
|
|
41
|
bless $self; |
83
|
23
|
|
|
|
|
40
|
return $self; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 address |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Returns FTN node address in 4D format. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub address { |
93
|
23
|
|
|
23
|
1
|
24
|
my $self = shift; |
94
|
23
|
|
|
|
|
54
|
return $self->{'__addr'}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 keyword |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Returns FTN node keyword (Pvt/Hold/Down/Zone/Region/Host/Hub). |
100
|
|
|
|
|
|
|
Empty string is used for regular node. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub keyword { |
105
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
106
|
0
|
|
|
|
|
0
|
return $self->{'__keyword'}; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 name |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Returns FTN node station name. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This field may also be used by IP nodes for a domain name, static IP |
114
|
|
|
|
|
|
|
address or E-Mail address for email tunnelling programs. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub name { |
119
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
120
|
0
|
|
|
|
|
0
|
return $self->{'__name'}; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 location |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Returns FTN node location |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub location { |
130
|
23
|
|
|
23
|
1
|
71
|
my $self = shift; |
131
|
23
|
|
|
|
|
55
|
return $self->{'__loc'}; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head2 sysop |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Returns FTN node sysop name |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub sysop { |
141
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
142
|
0
|
|
|
|
|
|
return $self->{'__sysop'}; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head2 phone |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Returns FTN node phone number (PSTN/ISDN) |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Can also contains C<'-Unpublished-'> value or 000-IP address. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=cut |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub phone { |
154
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
155
|
0
|
|
|
|
|
|
return $self->{'__phone'}; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head2 speed |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Returns FTN node DCE speed |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=cut |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
sub speed { |
165
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
166
|
0
|
|
|
|
|
|
return $self->{'__speed'}; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head2 flags |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Returns arrayref with FTN node flags |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=cut |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
sub flags { |
176
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
177
|
0
|
|
|
|
|
|
return $self->{'__flags'}; |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head1 AUTHORS |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
Serguei Trouchelle EFE |
185
|
|
|
|
|
|
|
Robert James Clay EFE |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head1 LICENSE |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
190
|
|
|
|
|
|
|
under the same terms as Perl itself. |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 COPYRIGHT |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Copyright (c) 2005 Serguei Trouchelle. All rights reserved. |
195
|
|
|
|
|
|
|
Copyright (c) 2013 Robert James Clay. All rights reserved. |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=cut |
198
|
|
|
|
|
|
|
|