return (1, $self->msg('e24')) unless $Internet::allow;
return (1, "SHOW/425 <callsign>, e.g. SH/425 3B9FR") unless @list;
my $target = $Internet::http_proxy || $Internet::dx425_url || "www.ariscandicci.it";
+#my $target = $Internet::http_proxy || $Internet::dx425_url || "192.168.0.2";
my $port = $Internet::http_proxy_port || 80;
my $url = '';
$url = 'http://' . ($Internet::dx425_url || 'www.ariscandicci.it'); # if $Internet::http_proxy;
+#$url = 'http://' . ($Internet::dx425_url || '192.168.0.2'); # if $Internet::http_proxy;
use Net::Telnet;
if (!$t || $@) {
push @out, $self->msg('e18', 'Open(425.org)');
} else {
- my $s = "GET $url/modules.php?name=425dxn&op=spider&query=$l";
+ my $s = "GET $url/modules.php?name=425dxn&op=spider&query=$l HTTP/1.0\n"
+ ."User-Agent:DxSpider;$main::version;$main::build;$^O;$main::mycall;$call;$l)\n\n";
dbg($s) if isdbg('425');
$t->print($s);
Log('call', "$call: show/425 \U$l");
my $state = "blank";
+ my $count = 1;
+# push @out, $s;
while (my $result = eval { $t->getline(Timeout => 30) } || $@) {
dbg($result) if isdbg('425') && $result;
- chomp $result;
+ ++$count;
+ if ($count > 10)
+ {
+ #chomp $result;
push @out, $result;
}
+ }
$t->close;
push @out, $self->msg('e3', 'Search(425.org)', uc $l) unless @out;
}
cw => [ 7000, 7034 ],
data => [ 7035, 7044],
rtty => [ 7035, 7044],
- ssb => [ 7051, 7400 ]
+ ssb => [ 7045, 7400 ]
}, 'Bands'),
'30m' => bless( { band => [ 10100, 10150 ],
my $call = $self->call;
return if $self->{disconnecting}++;
-
+
+ my $thing = Thingy::Bye->new(origin=>$main::mycall, user=>$call);
+ $thing->process($self);
+
# get rid of any PC16/17/19
-# eph_del_regex("^PC1[679]*$call");
+ eph_del_regex("^PC1[679]*$call");
# do routing stuff, remove me from routing table
my $node = Route::Node::get($call);
# and all my ephemera as well
for (@rout) {
my $c = $_->call;
-# eph_del_regex("^PC1[679].*$c");
+ eph_del_regex("^PC1[679].*$c");
}
}
);
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
# object destruction
sub DESTROY
use VE7CC;
use Thingy;
use Thingy::Dx;
+use Thingy::Hello;
+use Thingy::Bye;
use strict;
use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug $maxbadcount $msgpolltime);
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
#
# obtain a new connection this is derived from dxchannel
my @rout = $main::routeroot->add_user($call, Route::here(1));
# ALWAYS output the user
+ my $thing = Thingy::Hello->new(user => $self->{call});
+ $thing->broadcast($self);
+
my $ref = Route::User::get($call);
$main::me->route_pc16($main::mycall, undef, $main::routeroot, $ref) if $ref;
-
return $self;
}
# issue a pc17 to everybody interested
$main::me->route_pc17($main::mycall, undef, $main::routeroot, $uref);
+
+ my $thing = Thingy::Bye->new(user=>$call);
+ $thing->broadcast($self);
} else {
confess "trying to disconnect a non existant user $call";
}
use Thingy::Rt;
use Thingy::Ping;
use Thingy::T;
+use Thingy::Hello;
+use Thingy::Bye;
use strict;
my $pkg = shift;
my $call = shift;
$main::routeroot->add($call, '5000', Route::here(1)) if $call ne $main::mycall;
-
+ my $thing = Thingy::Hello->new(user=>$call);
+ $thing->broadcast($self);
+
return $self;
}
my $thing = Thingy::Dx->new(origin=>$main::mycall);
$thing->from_DXProt(DXProt=>$line,spotdata=>\@spot);
- $thing->queue($self);
+ $thing->process($self);
# this goes after the input filtering, but before the add
# so that if it is input filtered, it isn't added to the dup
}
}
}
-
- # local processing
- my $r;
- eval {
- $r = Local::spot($self, @spot);
- };
- # dbg("Local::spot1 error $@") if isdbg('local') if $@;
- return if $r;
-
- # DON'T be silly and send on PC26s!
- return if $pcno == 26;
-
- # send out the filtered spots
-# send_dx_spot($self, $line, @spot) if @spot;
}
# announces
eph_del_regex("^PC17\\^$call\\^$ncall");
my $flags = $here ? 1 : 0;
- $rout .= ":U$flags$call";
+ $rout .= "$flags$call:";
}
if ($rout) {
+ chop $rout;
my $thing = Thingy::Rt->new(origin=>$main::mycall, user=>$self->{call});
- $thing->from_DXProt(t=>'eau', d=>"N1$ncall$rout", DXProt=>$line);
- $thing->queue($self);
+ $thing->from_DXProt(t=>'au', $ncall eq $self->{call} ? () : ('n', "1$ncall"), u=>$rout, DXProt=>$line);
+ $thing->process($self);
} else {
dbg("PCPROT: No usable users") if isdbg('chanerr');
}
$uref = Route->new($ucall) unless $uref; # throw away
my $thing = Thingy::Rt->new(origin=>$main::mycall, user=>$self->{call});
- $thing->from_DXProt(t=>'edu', d=>"N1$ncall:U1$ucall", DXProt=>$line);
- $thing->queue($self);
+ $thing->from_DXProt(t=>'du', $ncall eq $self->{call} ? () : ('n', "1$ncall"), u=>"1$ucall", DXProt=>$line);
+ $thing->process($self);
}
# link request
# broadcast to all other nodes that all the nodes connected to via me are gone
unless ($pc39flag && $pc39flag == 2) {
+ my $thing = Thingy::Bye->new(user=>$call);
+ $thing->broadcast($self);
+
$self->route_pc21($main::mycall, undef, @rout) if @rout;
}
use strict;
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
use vars qw($sentencelth);
use strict;
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
use vars qw(%u $dbm $filename %valid $lastoperinterval $lasttime $lru $lrusize $tooold $v3);
push @queue, $thing;
}
+#
# this is the main commutator loop. In due course it will
-# become the *only* commutator loop
+# become the *only* commutator loop, This can be called in one
+# of two ways: either with 2 args or with none.
+#
+# The two arg form is an immediate "queue and handle" and does
+# a full cycle, immediately
+#
sub process
{
my $thing;
+ if (@_ == 2) {
+ $thing = shift;
+ $thing->queue(shift);
+ }
while (@queue) {
$thing = shift @queue;
my $dxchan = DXChannel->get($thing->{dxchan});
--- /dev/null
+#
+# Bye Thingy handling
+#
+# $Id$
+#
+# Copyright (c) 2005 Dirk Koopman G1TLH
+#
+
+use strict;
+
+package Thingy::Bye;
+
+use vars qw($VERSION $BRANCH);
+$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/ || (0,0));
+$main::build += $VERSION;
+$main::branch += $BRANCH;
+
+use DXChannel;
+use DXDebug;
+use Verify;
+use Thingy;
+
+use vars qw(@ISA);
+@ISA = qw(Thingy);
+
+sub gen_Aranea
+{
+ my $thing = shift;
+ unless ($thing->{Aranea}) {
+ my $s = sprintf "%X", int(rand() * 100000000);
+ my $auth = Verify->new("DXSp,$main::mycall,$s");
+ $thing->{Aranea} = Aranea::genmsg($thing, 'Bye',
+ 's'=>$s,
+ auth=>$auth->challenge($main::me->user->passphrase)
+ );
+ }
+ return $thing->{Aranea};
+}
+
+sub handle
+{
+ my $thing = shift;
+ my $dxchan = shift;
+
+ # verify authenticity
+ if ($dxchan->{call} eq $thing->{origin}) {
+
+ # for directly connected calls
+# if ($Thingy::Hello::verify_on_login) {
+# my $pp = $dxchan->user->passphrase;
+# unless ($pp) {
+# dbglog('err', "Thingy::Bye::handle: verify on and $thing->{origin} has no passphrase");
+# return;
+# }
+# my $auth = Verify->new("DXSp,$thing->{origin},$thing->{s}");
+# unless ($auth->verify($thing->{auth}, $dxchan->user->passphrase)) {
+# dbglog('err', "Thingy::Bye::handle: verify on and $thing->{origin} failed auth check");
+# return;
+# }
+# }
+
+ my $int = $thing->{user} || $thing->{origin};
+ RouteDB::delete_interface($int);
+ } else {
+
+ # for otherwise connected calls, that come in relayed from other nodes
+ # note that we cannot do any connections at this point
+ my $nref = Route::Node::get($thing->{origin});
+ if ($nref) {
+ if (my $user = $thing->{user}) {
+ my $ur = Route::get($user);
+ if ($ur) {
+ if ($ur->isa('Route::Node')) {
+ $nref->del($ur);
+ } elsif ($ur->isa('Route::User')) {
+ $nref->del_user($ur);
+ }
+ }
+ }
+ }
+ }
+
+
+ $thing->broadcast($dxchan);
+}
+
+sub new
+{
+ my $pkg = shift;
+ my $thing = $pkg->SUPER::new(origin=>$main::mycall, @_);
+ return $thing;
+}
+1;
package Thingy::Hello;
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
use DXChannel;
use DXDebug;
sub new
{
my $pkg = shift;
- my $thing = $pkg->SUPER::new(origin=>$main::mycall);
+ my $thing = $pkg->SUPER::new(origin=>$main::mycall, @_);
return $thing;
}
1;