available.
+17Oct00=======================================================================
+1. force frames to go down the local interface when doing a route. This is
+particularly important for pings!
16Oct00=======================================================================
1. add a ':' after 'G7BRN de G1TLH' in a talk message.
2. added /J to the list of things to ignore (as in G1TLH/J) in prefix
#
# PLEASE NOTE - I am a C programmer using this as a method of learning perl
# firstly and OO about ninthly (if you don't like the design and you can't
-# improve it with better OO by make it smaller and more efficient, then tough).
+# improve it with better OO and thus make it smaller and more efficient, then tough).
#
-# Copyright (c) 1998 - Dirk Koopman G1TLH
+# Copyright (c) 1998-2000 - Dirk Koopman G1TLH
#
# $Id$
#
pingave => '0,Ping ave time',
logininfo => '9,Login info req,yesno',
talklist => '0,Talk List,parray',
- node => '5,Node data',
+ cluster => '5,Cluster data',
);
# object destruction
confess $@ if $@;
$me->{sort} = 'S'; # S for spider
- # now prime the spot and wwv duplicates file with data
-# my @today = Julian::unixtoj(time);
-# for (Spot::readfile(@today), Spot::readfile(Julian::sub(@today, 1))) {
-# Spot::dup(@{$_}[0..3]);
-# }
-# for (Geomag::readfile(time)) {
-# Geomag::dup(@{$_}[1..5]);
-# }
-
# load the baddx file
do "$baddxfn" if -e "$baddxfn";
print "$@\n" if $@;
sub route
{
my ($self, $call, $line) = @_;
- my $cl = DXCluster->get_exact($call);
- if ($cl) { # don't route it back down itself
- if (ref $self && $call eq $self->{call}) {
- dbg('chan', "Trying to route back to source, dropped");
- return;
- }
- my $hops;
- my $dxchan = $cl->{dxchan};
- if ($dxchan) {
- my $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name
- if ($routeit) {
- $dxchan->send($routeit) if $dxchan;
- }
+
+ if (ref $self && $call eq $self->{call}) {
+ dbg('chan', "Trying to route back to source, dropped");
+ return;
+ }
+
+ # always send it down the local interface if available
+ my $dxchan = DXChannel->get($call);
+ unless ($dxchan) {
+ my $cl = DXCluster->get_exact($call);
+ $dxchan = $cl->dxchan if $cl;
+ }
+ if ($dxchan) {
+ my $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name
+ if ($routeit) {
+ $dxchan->send($routeit);
}
}
}
@EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf
parray parraypairs shellregex readfilestr writefilestr
print_all_fields cltounix iscallsign unpad is_callsign
- is_freq is_digits is_pctext is_pcflag
+ is_freq is_digits is_pctext is_pcflag insertitem deleteitem
);
@month = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
{
return $_[0] =~ /^[\d]+$/;
}
+
+# insert an item into a list if it isn't already there returns 1 if there 0 if not
+sub insertitem
+{
+ my $list = shift;
+ my $item = shift;
+
+ return 1 if grep {$_ eq $item } @$list;
+ push @$list, $item;
+ return 0;
+}
+
+# delete an item from a list if it is there returns no deleted
+sub deleteitem
+{
+ my $list = shift;
+ my $item = shift;
+ my $n = @$list;
+
+ @$list = grep {$_ ne $item } @$list;
+ return $n - @$list;
+}