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