fixed the talk problem
[spider.git] / perl / DXCommandmode.pm
1 #!/usr/bin/perl
2 #
3 # This module impliments the user facing command mode for a dx cluster
4 #
5 # Copyright (c) 1998 Dirk Koopman G1TLH
6 #
7 # $Id$
8
9
10 package DXCommandmode;
11
12 use POSIX;
13
14 @ISA = qw(DXChannel);
15
16 use DXUtil;
17 use DXChannel;
18 use DXUser;
19 use DXVars;
20 use DXDebug;
21 use DXM;
22 use DXLog;
23 use DXLogPrint;
24 use DXBearing;
25 use CmdAlias;
26 use Filter;
27 use Minimuf;
28 use DXDb;
29 use AnnTalk;
30 use WCY;
31 use Sun;
32 use Internet;
33
34 use strict;
35 use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug);
36
37 %Cache = ();                                    # cache of dynamically loaded routine's mod times
38 %cmd_cache = ();                                # cache of short names
39 $errstr = ();                                   # error string from eval
40 %aliases = ();                                  # aliases for (parts of) commands
41 $scriptbase = "$main::root/scripts"; # the place where all users start scripts go
42 $maxerrors = 20;                                # the maximum number of concurrent errors allowed before disconnection
43
44 #
45 # obtain a new connection this is derived from dxchannel
46 #
47
48 sub new 
49 {
50         my $self = DXChannel::alloc(@_);
51
52         # routing, this must go out here to prevent race condx
53         my $pkg = shift;
54         my $call = shift;
55         my @rout = $main::routeroot->add_user($call, Route::here(1));
56         DXProt::route_pc16($DXProt::me, $main::routeroot, @rout) if @rout;
57
58         return $self;
59 }
60
61 # this is how a a connection starts, you get a hello message and the motd with
62 # possibly some other messages asking you to set various things up if you are
63 # new (or nearly new and slacking) user.
64
65 sub start
66
67         my ($self, $line, $sort) = @_;
68         my $user = $self->{user};
69         my $call = $self->{call};
70         my $name = $user->{name};
71         
72         $self->{name} = $name ? $name : $call;
73         $self->send($self->msg('l2',$self->{name}));
74         $self->send_file($main::motd) if (-e $main::motd);
75         $self->state('prompt');         # a bit of room for further expansion, passwords etc
76         $self->{priv} = $user->priv || 0;
77         $self->{lang} = $user->lang || $main::lang || 'en';
78         $self->{pagelth} = $user->pagelth || 20;
79         $self->{priv} = 0 if $line =~ /^(ax|te)/; # set the connection priv to 0 - can be upgraded later
80         $self->{consort} = $line;       # save the connection type
81         
82         # set some necessary flags on the user if they are connecting
83         $self->{beep} = $user->wantbeep;
84         $self->{ann} = $user->wantann;
85         $self->{wwv} = $user->wantwwv;
86         $self->{wcy} = $user->wantwcy;
87         $self->{talk} = $user->wanttalk;
88         $self->{wx} = $user->wantwx;
89         $self->{dx} = $user->wantdx;
90         $self->{logininfo} = $user->wantlogininfo;
91         $self->{here} = 1;
92
93         # get the filters
94         $self->{spotsfilter} = Filter::read_in('spots', $call, 0) || Filter::read_in('spots', 'user_default', 0);
95         $self->{wwvfilter} = Filter::read_in('wwv', $call, 0) || Filter::read_in('wwv', 'user_default', 0);
96         $self->{wcyfilter} = Filter::read_in('wcy', $call, 0) || Filter::read_in('wcy', 'user_default', 0);
97         $self->{annfilter} = Filter::read_in('ann', $call, 0) || Filter::read_in('ann', 'user_default', 0) ;
98
99         # clean up qra locators
100         my $qra = $user->qra;
101         $qra = undef if ($qra && !DXBearing::is_qra($qra));
102         unless ($qra) {
103                 my $lat = $user->lat;
104                 my $long = $user->long;
105                 $user->qra(DXBearing::lltoqra($lat, $long)) if (defined $lat && defined $long);  
106         }
107
108         Log('DXCommand', "$call connected");
109
110         # send prompts and things
111         my $info = Route::cluster();
112         $self->send("Cluster:$info");
113         $self->send($self->msg('namee1')) if !$user->name;
114         $self->send($self->msg('qthe1')) if !$user->qth;
115         $self->send($self->msg('qll')) if !$user->qra || (!$user->lat && !$user->long);
116         $self->send($self->msg('hnodee1')) if !$user->qth;
117         $self->send($self->msg('m9')) if DXMsg::for_me($call);
118         $self->prompt;
119
120         # decide on echo
121         if (!$user->wantecho) {
122                 $self->send_now('E', "0");
123                 $self->send($self->msg('echow'));
124         }
125         
126         $self->tell_login('loginu');
127         
128 }
129
130 #
131 # This is the normal command prompt driver
132 #
133
134 sub normal
135 {
136         my $self = shift;
137         my $cmdline = shift;
138         my @ans;
139         
140         # remove leading and trailing spaces
141         $cmdline =~ s/^\s*(.*)\s*$/$1/;
142         
143         if ($self->{state} eq 'page') {
144                 my $i = $self->{pagelth};
145                 my $ref = $self->{pagedata};
146                 my $tot = @$ref;
147                 
148                 # abort if we get a line starting in with a
149                 if ($cmdline =~ /^a/io) {
150                         undef $ref;
151                         $i = 0;
152                 }
153         
154                 # send a tranche of data
155                 while ($i-- > 0 && @$ref) {
156                         my $line = shift @$ref;
157                         $line =~ s/\s+$//o;     # why am having to do this? 
158                         $self->send($line);
159                 }
160                 
161                 # reset state if none or else chuck out an intermediate prompt
162                 if ($ref && @$ref) {
163                         $tot -= $self->{pagelth};
164                         $self->send($self->msg('page', $tot));
165                 } else {
166                         $self->state('prompt');
167                 }
168         } elsif ($self->{state} eq 'sysop') {
169                 my $passwd = $self->{user}->passwd;
170                 my @pw = split / */, $passwd;
171                 if ($passwd) {
172                         my @l = @{$self->{passwd}};
173                         my $str = "$pw[$l[0]].*$pw[$l[1]].*$pw[$l[2]].*$pw[$l[3]].*$pw[$l[4]]";
174                         if ($cmdline =~ /$str/) {
175                                 $self->{priv} = $self->{user}->priv;
176                         } else {
177                                 $self->send($self->msg('sorry'));
178                         }
179                 } else {
180                         $self->send($self->msg('sorry'));
181                 }
182                 delete $self->{passwd};
183                 $self->state('prompt');
184         } elsif ($self->{state} eq 'talk') {
185                 if ($cmdline =~ m{^(?:/EX|/ABORT)}i) {
186                         for (@{$self->{talklist}}) {
187                                 $self->send_talks($_,  $self->msg('talkend'));
188                         }
189                         $self->state('prompt');
190                         delete $self->{talklist};
191                 } elsif ($cmdline =~ m(^/\w+)) {
192                         $cmdline =~ s(^/)();
193                         $self->send_ans(run_cmd($self, $cmdline));
194                         $self->send($self->talk_prompt);
195                 } elsif ($self->{talklist} && @{$self->{talklist}}) {
196                         # send what has been said to whoever is in this person's talk list
197                         for (@{$self->{talklist}}) {
198                                 $self->send_talks($_, $cmdline);
199                         }
200                         $self->send($self->talk_prompt) if $self->{state} eq 'talk';
201                 } else {
202                         # for safety
203                         $self->state('prompt');
204                 }
205         } else {
206                 $self->send_ans(run_cmd($self, $cmdline));
207         } 
208         
209         # send a prompt only if we are in a prompt state
210         $self->prompt() if $self->{state} =~ /^prompt/o;
211 }
212
213 # send out the talk messages taking into account vias and connectivity
214 sub send_talks
215 {
216         my ($self, $ent, $line) = @_;
217         
218         my ($to, $via) = $ent =~ /(\S+)>(\S+)/;
219         $to = $ent unless $to;
220         my $call = $via ? $via : $to;
221         my $clref = Route::get($call);
222         my $dxchan = $clref->dxchan if $clref;
223         if ($dxchan) {
224                 $dxchan->talk($self->{call}, $to, $via, $line);
225         } else {
226                 $self->send($self->msg('disc2', $via ? $via : $to));
227                 my @l = grep { $_ ne $ent } @{$self->{talklist}};
228                 if (@l) {
229                         $self->{talklist} = \@l;
230                 } else {
231                         delete $self->{talklist};
232                         $self->state('prompt');
233                 }
234         }
235 }
236
237 sub talk_prompt
238 {
239         my $self = shift;
240         my @call;
241         for (@{$self->{talklist}}) {
242                 my ($to, $via) = /(\S+)>(\S+)/;
243                 $to = $_ unless $to;
244                 push @call, $to;
245         }
246         return $self->msg('talkprompt', join(',', @call));
247 }
248
249 #
250 # send a load of stuff to a command user with page prompting
251 # and stuff
252 #
253
254 sub send_ans
255 {
256         my $self = shift;
257         
258         if ($self->{pagelth} && @_ > $self->{pagelth}) {
259                 my $i;
260                 for ($i = $self->{pagelth}; $i-- > 0; ) {
261                         my $line = shift @_;
262                         $line =~ s/\s+$//o;     # why am having to do this? 
263                         $self->send($line);
264                 }
265                 $self->{pagedata} =  [ @_ ];
266                 $self->state('page');
267                 $self->send($self->msg('page', scalar @_));
268         } else {
269                 for (@_) {
270                         if (defined $_) {
271                                 $self->send($_);
272                         } else {
273                                 $self->send('');
274                         }
275                 }
276         } 
277 }
278
279 # this is the thing that runs the command, it is done like this for the 
280 # benefit of remote command execution
281 #
282
283 sub run_cmd
284 {
285         my $self = shift;
286         my $user = $self->{user};
287         my $call = $self->{call};
288         my $cmdline = shift;
289         my @ans;
290         
291         if ($self->{func}) {
292                 my $c = qq{ \@ans = $self->{func}(\$self, \$cmdline) };
293                 dbg("stored func cmd = $c\n") if isdbg('eval');
294                 eval  $c;
295                 if ($@) {
296                         return ("Syserr: Eval err $errstr on stored func $self->{func}", $@);
297                 }
298         } else {
299
300                 return () if length $cmdline == 0;
301                 
302                 # strip out //
303                 $cmdline =~ s|//|/|og;
304                 
305                 # split the command line up into parts, the first part is the command
306                 my ($cmd, $args) = split /\s+/, $cmdline, 2;
307                 $args = "" unless defined $args;
308                 
309                 if ($cmd) {
310                         
311                         my ($path, $fcmd);
312                         
313                         dbg("cmd: $cmd") if isdbg('command');
314                         
315                         # alias it if possible
316                         my $acmd = CmdAlias::get_cmd($cmd);
317                         if ($acmd) {
318                                 ($cmd, $args) = split /\s+/, "$acmd $args", 2;
319                                 $args = "" unless defined $args;
320                                 dbg("aliased cmd: $cmd $args") if isdbg('command');
321                         }
322                         
323                         # first expand out the entry to a command
324                         ($path, $fcmd) = search($main::localcmd, $cmd, "pl");
325                         ($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
326
327                         if ($path && $cmd) {
328                                 dbg("path: $cmd cmd: $fcmd") if isdbg('command');
329                         
330                                 my $package = find_cmd_name($path, $fcmd);
331                                 @ans = (0) if !$package ;
332                                 
333                                 if ($package) {
334                                         dbg("package: $package") if isdbg('command');
335                                         my $c;
336                                         unless (exists $Cache{$package}->{'sub'}) {
337                                                 $c = eval $Cache{$package}->{'eval'};
338                                                 if ($@) {
339                                                         return DXDebug::shortmess($@);
340                                                 }
341                                                 $Cache{$package}->{'sub'} = $c;
342                                         }
343                                         $c = $Cache{$package}->{'sub'};
344                                         eval {
345                                                 @ans = &{$c}($self, $args);
346                                     };
347                                         
348                                         if ($@) {
349                                                 #cluck($@);
350                                                 return (DXDebug::shortmess($@));
351                                         };
352                                 }
353                         } else {
354                                 dbg("cmd: $cmd not found") if isdbg('command');
355                                 if (++$self->{errors} > $maxerrors) {
356                                         $self->send($self->msg('e26'));
357                                         $self->disconnect;
358                                         return ();
359                                 } else {
360                                         return ($self->msg('e1'));
361                                 }
362                         }
363                 }
364         }
365         
366         my $ok = shift @ans;
367         if ($ok) {
368                 delete $self->{errors};
369         } else {
370                 if (++$self->{errors} > $maxerrors) {
371                         $self->send($self->msg('e26'));
372                         $self->disconnect;
373                         return ();
374                 }
375         }
376         return (@ans);
377 }
378
379 #
380 # This is called from inside the main cluster processing loop and is used
381 # for despatching commands that are doing some long processing job
382 #
383 sub process
384 {
385         my $t = time;
386         my @dxchan = DXChannel->get_all();
387         my $dxchan;
388         
389         foreach $dxchan (@dxchan) {
390                 next if $dxchan->sort ne 'U';  
391                 
392                 # send a prompt if no activity out on this channel
393                 if ($t >= $dxchan->t + $main::user_interval) {
394                         $dxchan->prompt() if $dxchan->{state} =~ /^prompt/o;
395                         $dxchan->t($t);
396                 }
397         }
398
399         while (my ($k, $v) = each %nothereslug) {
400                 if ($main::systime >= $v + 300) {
401                         delete $nothereslug{$k};
402                 }
403         }
404 }
405
406 #
407 # finish up a user context
408 #
409 sub disconnect
410 {
411         my $self = shift;
412         my $call = $self->call;
413         delete $self->{senddbg};
414
415         my @rout = $main::routeroot->del_user($call);
416         dbg("B/C PC17 on $main::mycall for: $call") if isdbg('route');
417
418         # issue a pc17 to everybody interested
419         DXProt::route_pc17($DXProt::me, $main::routeroot, @rout) if @rout;
420
421         # I was the last node visited
422     $self->user->node($main::mycall);
423                 
424         # send info to all logged in thingies
425         $self->tell_login('logoutu');
426
427         Log('DXCommand', "$call disconnected");
428
429         $self->SUPER::disconnect;
430 }
431
432 #
433 # short cut to output a prompt
434 #
435
436 sub prompt
437 {
438         my $self = shift;
439         $self->send($self->msg($self->here ? 'pr' : 'pr2', $self->call, cldate($main::systime), ztime($main::systime)));
440 }
441
442 # broadcast a message to all users [except those mentioned after buffer]
443 sub broadcast
444 {
445         my $pkg = shift;                        # ignored
446         my $s = shift;                          # the line to be rebroadcast
447         
448     foreach my $dxchan (DXChannel->get_all()) {
449                 next unless $dxchan->{sort} eq 'U'; # only interested in user channels  
450                 next if grep $dxchan == $_, @_;
451                 $dxchan->send($s);                      # send it
452         }
453 }
454
455 # gimme all the users
456 sub get_all
457 {
458         return grep {$_->{sort} eq 'U'} DXChannel->get_all();
459 }
460
461 # run a script for this user
462 sub run_script
463 {
464         my $self = shift;
465         my $silent = shift || 0;
466         
467 }
468
469 #
470 # search for the command in the cache of short->long form commands
471 #
472
473 sub search
474 {
475         my ($path, $short_cmd, $suffix) = @_;
476         my ($apath, $acmd);
477         
478         # commands are lower case
479         $short_cmd = lc $short_cmd;
480         dbg("command: $path $short_cmd\n") if isdbg('command');
481
482         # do some checking for funny characters
483         return () if $short_cmd =~ /\/$/;
484
485         # return immediately if we have it
486         ($apath, $acmd) = split ',', $cmd_cache{$short_cmd} if $cmd_cache{$short_cmd};
487         if ($apath && $acmd) {
488                 dbg("cached $short_cmd = ($apath, $acmd)\n") if isdbg('command');
489                 return ($apath, $acmd);
490         }
491         
492         # if not guess
493         my @parts = split '/', $short_cmd;
494         my $dirfn;
495         my $curdir = $path;
496         my $p;
497         my $i;
498         my @lparts;
499         
500         for ($i = 0; $i < @parts; $i++) {
501                 my  $p = $parts[$i];
502                 opendir(D, $curdir) or confess "can't open $curdir $!";
503                 my @ls = readdir D;
504                 closedir D;
505                 my $l;
506                 foreach $l (sort @ls) {
507                         next if $l =~ /^\./;
508                         if ($i < $#parts) {             # we are dealing with directories
509                                 if ((-d "$curdir/$l") && $p eq substr($l, 0, length $p)) {
510                                         dbg("got dir: $curdir/$l\n") if isdbg('command');
511                                         $dirfn .= "$l/";
512                                         $curdir .= "/$l";
513                                         last;
514                                 }
515                         } else {                        # we are dealing with commands
516                                 @lparts = split /\./, $l;                  
517                                 next if $lparts[$#lparts] ne $suffix;        # only look for .$suffix files
518                                 if ($p eq substr($l, 0, length $p)) {
519                                         pop @lparts; #  remove the suffix
520                                         $l = join '.', @lparts;
521                                         #                 chop $dirfn;               # remove trailing /
522                                         $dirfn = "" unless $dirfn;
523                                         $cmd_cache{"$short_cmd"} = join(',', ($path, "$dirfn$l")); # cache it
524                                         dbg("got path: $path cmd: $dirfn$l\n") if isdbg('command');
525                                         return ($path, "$dirfn$l"); 
526                                 }
527                         }
528                 }
529         }
530         return ();  
531 }  
532
533 # clear the command name cache
534 sub clear_cmd_cache
535 {
536         %cmd_cache = ();
537 }
538
539 #
540 # the persistant execution of things from the command directories
541 #
542 #
543 # This allows perl programs to call functions dynamically
544
545 # This has been nicked directly from the perlembed pages
546 #
547
548 #require Devel::Symdump;  
549
550 sub valid_package_name {
551         my($string) = @_;
552         $string =~ s/([^A-Za-z0-9\/])/sprintf("_%2x",unpack("C",$1))/eg;
553         
554         #second pass only for words starting with a digit
555         $string =~ s|/(\d)|sprintf("/_%2x",unpack("C",$1))|eg;
556         
557         #Dress it up as a real package name
558         $string =~ s/\//_/og;
559         return $string;
560 }
561
562 # find a cmd reference
563 # this is really for use in user written stubs
564 #
565 # use the result as a symbolic reference:-
566 #
567 # no strict 'refs';
568 # @out = &$r($self, $line);
569 #
570 sub find_cmd_ref
571 {
572         my $cmd = shift;
573         my $r;
574         
575         if ($cmd) {
576                 
577                 # first expand out the entry to a command
578                 my ($path, $fcmd) = search($main::localcmd, $cmd, "pl");
579                 ($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
580                 
581                 # make sure it is loaded
582                 $r = find_cmd_name($path, $fcmd);
583         }
584         return $r;
585 }
586
587
588 # this bit of magic finds a command in the offered directory
589 sub find_cmd_name {
590         my $path = shift;
591         my $cmdname = shift;
592         my $package = valid_package_name($cmdname);
593         my $filename = "$path/$cmdname.pl";
594         my $mtime = -M $filename;
595         
596         # return if we can't find it
597         $errstr = undef;
598         unless (defined $mtime) {
599                 $errstr = DXM::msg('e1');
600                 return undef;
601         }
602         
603         if(defined $Cache{$package}->{mtime} &&$Cache{$package}->{mtime} <= $mtime) {
604                 #we have compiled this subroutine already,
605                 #it has not been updated on disk, nothing left to do
606                 #print STDERR "already compiled $package->handler\n";
607                 ;
608         } else {
609
610                 my $sub = readfilestr($filename);
611                 unless ($sub) {
612                         $errstr = "Syserr: can't open '$filename' $!";
613                         return undef;
614                 };
615                 
616                 #wrap the code into a subroutine inside our unique package
617                 my $eval = qq( sub { $sub } );
618                 
619                 if (isdbg('eval')) {
620                         my @list = split /\n/, $eval;
621                         my $line;
622                         for (@list) {
623                                 dbg($_ . "\n") if isdbg('eval');
624                         }
625                 }
626                 
627                 $Cache{$package} = {mtime => $mtime, 'eval' => $eval };
628         }
629
630         return $package;
631 }
632
633 sub local_send
634 {
635         my ($self, $let, $buf) = @_;
636         if ($self->{state} eq 'prompt' || $self->{state} eq 'talk') {
637                 if ($self->{enhanced}) {
638                         $self->send_later($let, $buf);
639                 } else {
640                         $self->send($buf);
641                 }
642         } else {
643                 $self->delay($buf);
644         }
645 }
646
647 # send a talk message here
648 sub talk
649 {
650         my ($self, $from, $to, $via, $line) = @_;
651         $line =~ s/\\5E/\^/g;
652         $self->local_send('T', "$to de $from: $line") if $self->{talk};
653         Log('talk', $to, $from, $main::mycall, $line);
654         # send a 'not here' message if required
655         unless ($self->{here} && $from ne $to) {
656                 my $key = "$to$from";
657                 unless (exists $nothereslug{$key}) {
658                         my ($ref, $dxchan);
659                         if (($ref = Route::get($from)) && ($dxchan = $ref->dxchan)) {
660                                 my $name = $self->user->name || $to;
661                                 my $s = $self->user->nothere || $dxchan->msg('nothere', $name);
662                                 $nothereslug{$key} = $main::systime;
663                                 $dxchan->talk($to, $from, undef, $s);
664                         }
665                 }
666         }
667 }
668
669 # send an announce
670 sub announce
671 {
672         my $self = shift;
673         my $line = shift;
674         my $isolate = shift;
675         my $to = shift;
676         my $target = shift;
677         my $text = shift;
678         my ($filter, $hops);
679
680         if ($self->{annfilter}) {
681                 ($filter, $hops) = $self->{annfilter}->it(@_ );
682                 return unless $filter;
683         }
684
685         unless ($self->{ann}) {
686                 return if $_[0] ne $main::myalias && $_[0] ne $main::mycall;
687         }
688         return if $target eq 'SYSOP' && $self->{priv} < 5;
689         my $buf = "$to$target de $_[0]: $text";
690         $buf =~ s/\%5E/^/g;
691         $buf .= "\a\a" if $self->{beep};
692         $self->local_send($target eq 'WX' ? 'W' : 'N', $buf);
693 }
694
695 # send a dx spot
696 sub dx_spot
697 {
698         my $self = shift;
699         my $line = shift;
700         my $isolate = shift;
701         my ($filter, $hops);
702
703         return unless $self->{dx};
704         
705         if ($self->{spotsfilter}) {
706                 ($filter, $hops) = $self->{spotsfilter}->it(@_ );
707                 return unless $filter;
708         }
709
710         my $buf = Spot::formatb($self->{user}->wantgrid, $_[0], $_[1], $_[2], $_[3], $_[4]);
711         $buf .= "\a\a" if $self->{beep};
712         $buf =~ s/\%5E/^/g;
713         $self->local_send('X', $buf);
714 }
715
716 sub wwv
717 {
718         my $self = shift;
719         my $line = shift;
720         my $isolate = shift;
721         my ($filter, $hops);
722
723         return unless $self->{wwv};
724         
725         if ($self->{wwvfilter}) {
726                 ($filter, $hops) = $self->{wwvfilter}->it(@_ );
727                 return unless $filter;
728         }
729
730         my $buf = "WWV de $_[6] <$_[1]>:   SFI=$_[2], A=$_[3], K=$_[4], $_[5]";
731         $buf .= "\a\a" if $self->{beep};
732         $self->local_send('V', $buf);
733 }
734
735 sub wcy
736 {
737         my $self = shift;
738         my $line = shift;
739         my $isolate = shift;
740         my ($filter, $hops);
741
742         return unless $self->{wcy};
743         
744         if ($self->{wcyfilter}) {
745                 ($filter, $hops) = $self->{wcyfilter}->it(@_ );
746                 return unless $filter;
747         }
748
749         my $buf = "WCY de $_[10] <$_[1]> : K=$_[4] expK=$_[5] A=$_[3] R=$_[6] SFI=$_[2] SA=$_[7] GMF=$_[8] Au=$_[9]";
750         $buf .= "\a\a" if $self->{beep};
751         $self->local_send('Y', $buf);
752 }
753
754 # broadcast debug stuff to all interested parties
755 sub broadcast_debug
756 {
757         my $s = shift;                          # the line to be rebroadcast
758         
759         foreach my $dxchan (DXChannel->get_all) {
760                 next unless $dxchan->{enhanced} && $dxchan->{senddbg};
761                 $dxchan->send_later('L', $s);
762         }
763 }
764
765
766 1;
767 __END__