]> dxcluster.org Git - spider.git/commitdiff
add in last config time
authorminima <minima>
Tue, 22 Feb 2005 19:25:50 +0000 (19:25 +0000)
committerminima <minima>
Tue, 22 Feb 2005 19:25:50 +0000 (19:25 +0000)
make the aranea protocol stuff master!

perl/Aranea.pm
perl/DXChannel.pm
perl/DXProt.pm
perl/Thingy/Rt.pm

index 726a068d896a1180b76900ab44bd7605ca3e8f43..787fc5389986f01c869d75b1bc91222c6a0da8e3 100644 (file)
@@ -124,6 +124,7 @@ sub start
        unless ($self->{outbound}) {
                my $thing = Thingy::Rt->new_cf;
                $thing->broadcast;
+               $self->lastcf($main::systime);
        }
        
        # run a script send the output to the debug file
index ad6e46b7194f0ef469fb6797c0425adc4590980c..f6a98cb14a1c18dad119ece5f4b3d14e60ea73a7 100644 (file)
@@ -118,6 +118,7 @@ $count = 0;
                  lastmsgpoll => '0,Last Msg Poll,atime',
                  inscript => '9,In a script,yesno',
                  inqueue => '9,Input Queue,parray',
+                 lastcf => '1,Last CF Update,atime',
                 );
 
 use vars qw($VERSION $BRANCH);
index 8f16da6603436b57eb6b36831bfc5b19c7085eed..4b34975c2b00920d7811c8b9c6ac6c4b6a357fb9 100644 (file)
@@ -786,18 +786,24 @@ sub handle_16
                # input filter if required
                return unless $self->in_filter_route($parent);
        }
+
+       # is he under the control of the new protocol?
+       if ($parent && $parent->np) {
+               dbg("PCPROT: $ncall aranea node, ignored") if isdbg('chanerr');
+               return;
+       }
                
-               my $i;
+       my $i;
        my @rout;
-               for ($i = 2; $i < $#_; $i++) {
-                       my ($call, $conf, $here) = $_[$i] =~ /^(\S+) (\S) (\d)/o;
-                       next unless $call && $conf && defined $here && is_callsign($call);
-                       next if $call eq $main::mycall;
-                       
-                       eph_del_regex("^PC17\\^$call\\^$ncall");
-                               
+       for ($i = 2; $i < $#_; $i++) {
+               my ($call, $conf, $here) = $_[$i] =~ /^(\S+) (\S) (\d)/o;
+               next unless $call && $conf && defined $here && is_callsign($call);
+               next if $call eq $main::mycall;
+               
+               eph_del_regex("^PC17\\^$call\\^$ncall");
+               
                $conf = $conf eq '*';
-
+               
                # reject this if we think it is a node already
                my $r = Route::Node::get($call);
                my $u = DXUser->get_current($call) unless $r;
@@ -808,19 +814,19 @@ sub handle_16
                
                $r = Route::User::get($call);
                my $flags = Route::here($here)|Route::conf($conf);
-
+               
                if ($r) {
                        my $au = $r->addparent($parent);                                        
                        if ($r->flags != $flags) {
                                $r->flags($flags);
                                $au = $r;
-               }
+                       }
                        push @rout, $r if $au;
-       } else {
+               } else {
                        push @rout, $parent->add_user($call, $flags);
                }
                
-                               
+               
                # add this station to the user database, if required
                $call =~ s/-\d+$//o;    # remove ssid for users
                my $user = DXUser->get_current($call);
@@ -883,6 +889,12 @@ sub handle_17
                return;
        }
 
+       # is he under the control of the new protocol?
+       if ($parent && $parent->np) {
+               dbg("PCPROT: $ncall aranea node, ignored") if isdbg('chanerr');
+               return;
+       }
+
        # input filter if required and then remove user if present
        if ($parent) {
 #              return unless $self->in_filter_route($parent);  
@@ -1036,6 +1048,11 @@ sub handle_19
                my $r = Route::Node::get($call);
                my $flags = Route::here($here)|Route::conf($conf);
 
+               # is he under the control of the new protocol?
+               if ($r->np) {
+                       dbg("PCPROT: $call aranea node, ignored") if isdbg('chanerr');
+                       next;
+               }
                # modify the routing table if it is in it, otherwise store it in the pc19list for now
                if ($r) {
                        my $ar;
@@ -1097,6 +1114,7 @@ sub handle_20
        my $thing = Thingy::Rt->new(user=>$self->{call});
        my $nref = Route::Node::get($self->{call});
        $thing->broadcast if $thing->copy_pc16_data($nref);
+       $self->lastcf($main::systime);
 }
                
 # delete a cluster from the list
@@ -1155,6 +1173,12 @@ sub handle_21
                                                
                                # input filter it
                                return unless $self->in_filter_route($node);
+
+                               # is he under the control of the new protocol?
+                               if ($node->np) {
+                                       dbg("PCPROT: $call aranea node, ignored") if isdbg('chanerr');
+                                       return;
+                               }
                                                
                                # routing objects
                                push @rout, $node->del($parent);
@@ -1180,6 +1204,7 @@ sub handle_22
        my $thing = Thingy::Rt->new(user=>$self->{call});
        my $nref = Route::Node::get($self->{call});
        $thing->broadcast if $thing->copy_pc16_data($nref);
+       $self->lastcf($main::systime);
 }
                                
 # WWV info
index fe26feaf5292493bc922eac1a4ef419b307d931d..362904d01cac4b311eb2679e379f0afbea16f25e 100644 (file)
@@ -24,12 +24,16 @@ use Thingy;
 use Thingy::RouteFilter;
 use Spot;
 
-use vars qw(@ISA);
+use vars qw(@ISA $update_interval);
 @ISA = qw(Thingy Thingy::RouteFilter);
 
+$update_interval = 30 * 60;            # the interval between 'cf' updates for an interface
+
 sub gen_Aranea
 {
        my $thing = shift;
+       my $dxchan = shift;
+       
        unless ($thing->{Aranea}) {
                my $ref;
                if ($ref = $thing->{anodes}) {
@@ -43,6 +47,7 @@ sub gen_Aranea
                }
                $thing->{Aranea} = Aranea::genmsg($thing, [qw(s a n u)]);
        }
+       
        return $thing->{Aranea};
 }