2 # This module is part of the new protocal mode for a dx cluster
4 # This module handles the initialisation between two nodes
6 # Copyright (c) 2003 Dirk Koopman G1TLH
15 use vars qw(@ISA $VERSION $BRANCH);
18 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
19 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
20 $main::build += $VERSION;
21 $main::branch += $BRANCH;
26 my ($self, $to, $from, $msgid, $line) = @_;
28 my @f = split /\^/, $line;
29 if ($self->user->passphrase && @f > 3) {
30 my $inv = Verify->new($f[3]);
31 unless ($inv->verify($f[4], $main::me->user->passphrase, $main::mycall, $self->call)) {
32 $self->sendnow('D','Sorry...');
35 $self->{verified} = 1;
37 $self->{verified} = 0;
39 if ($self->{outbound}) {
40 $self->send($self->QXI::gen);
42 if ($self->{sort} ne 'S' && $f[0] eq 'DXSpider') {
43 $self->{user}->{sort} = $self->{sort} = 'S';
44 $self->{user}->{priv} = $self->{priv} = 1 unless $self->{priv};
46 $self->{version} = $f[1];
47 $self->{build} = $f[2];
48 $self->state('init1');
49 $self->{lastping} = 0;
55 my @out = ('I', $self->call, "DXSpider", ($main::version + 53) * 100, $main::build);
56 if (my $pass = $self->user->passphrase) {
57 my $inp = Verify->new;
58 push @out, $inp->challenge, $inp->response($pass, $self->call, $main::mycall);
60 return $self->frame(@out);