get the basic QX01 handling working in the out direction
authorminima <minima>
Thu, 11 Jul 2002 18:30:50 +0000 (18:30 +0000)
committerminima <minima>
Thu, 11 Jul 2002 18:30:50 +0000 (18:30 +0000)
perl/DXProt.pm
perl/QXProt.pm

index 750b88839cfe7feb9554531aa47808b2eead30f8..0bd23a7ea16e9c80ed95500d092d113e95caec6b 100644 (file)
@@ -1914,6 +1914,8 @@ sub broadcast_route
                foreach $dxchan (@dxchan) {
                        next if $dxchan == $self;
                        next if $dxchan == $main::me;
+                       next if $dxchan->user->wantnp;
+                       
                        $dxchan->send_route($generate, @_);
                }
        }
index b277e3bd910687f8f6b4602a47122287a3c72dfa..d3b4d7427b32cd13469e755576516ff4c2b14fa6 100644 (file)
@@ -79,12 +79,12 @@ sub normal
        my ($id, $fromnode, $msgid, $incs);
        return unless ($id, $fromnode, $msgid, $incs) = $_[1] =~ /^QX(\d\d)\^([-A-Z0-9]+)\^([0-9A-F]{1,4})\^.*\^([0-9A-F]{2})$/;
 
+       $msgid = hex $msgid;
        my $noderef = Route::Node::get($fromnode);
        $noderef = Route::Node::new($fromnode) unless $noderef;
-       my $user = DXChannel->get_current($fromnode);
 
        my $il = length $incs; 
-       my $cs = sprintf("%02X", unpack("%32C*", substr($_[1], 0, length($_[1]) - ($il+1))));
+       my $cs = sprintf("%02X", unpack("%32C*", substr($_[1], 0, length($_[1]) - ($il+1))) & 255);
        if ($incs ne $cs) {
                dbg("QXPROT: Checksum fail in: $incs ne calc: $cs" ) if isdbg('chanerr');
                return;
@@ -102,7 +102,7 @@ sub handle
        my $self = shift;
        my $id = 0 + shift;
        my $sub = "handle$id";
-       $self->$sub($self, @_) if $self->can($sub);
+       $self->$sub(@_) if $self->can($sub);
        return;
 }
 
@@ -112,7 +112,7 @@ sub gen
        my $self = shift;
        my $id = 0 + shift;
        my $sub = "gen$id";
-       $self->$sub($self, @_) if $self->can($sub);
+       $self->$sub(@_) if $self->can($sub);
        return;
 }
 
@@ -162,20 +162,20 @@ sub handle1
        my $self = shift;
        
        my @f = split /\^/, $_[2];
-       my $inv = Verify->new($f[5]);
-       unless ($inv->verify($main::me->user->passphrase, $f[6], $main::mycall, $self->call)) {
+       my $inv = Verify->new($f[7]);
+       unless ($inv->verify($f[8], $main::me->user->passphrase, $main::mycall, $self->call)) {
                $self->sendnow('D','Sorry...');
                $self->disconnect;
        }
        if ($self->{outbound}) {
                $self->send($self->gen1);
        } 
-       if ($self->{sort} ne 'S' && $f[2] eq 'DXSpider') {
+       if ($self->{sort} ne 'S' && $f[4] eq 'DXSpider') {
                $self->{user}->{sort} = $self->{sort} = 'S';
                $self->{user}->{priv} = $self->{priv} = 1 unless $self->{priv};
        }
-       $self->{version} = $f[3];
-       $self->{build} = $f[4];
+       $self->{version} = $f[5];
+       $self->{build} = $f[6];
        $self->state('normal');
        $self->{lastping} = 0;
 }
@@ -184,7 +184,7 @@ sub gen1
 {
        my $self = shift;
        my $inp = Verify->new;
-       return frame(1, 1, "DXSpider", $main::version + 53, $main::build, $inp->challenge, $inp->response($self->user->passphrase, $self->call, $main::mycall));
+       return frame(1, 1, "DXSpider", ($main::version + 53) * 100, $main::build, $inp->challenge, $inp->response($self->user->passphrase, $self->call, $main::mycall));
 }
 
 sub handle2