+18Jun99=======================================================================
+1. fixed a problem with DXLogPrint repeating log entries.
+2. altered the permissions on disconnnect so that priv 5 users can disconnect
+clusters, but still require priv 8 to disconnect users.
+3. made sure that an incoming PC18 clears out all the cluster info for
+that channel before re-initialising.
+4. add init command.
+5. disconnect users before nodess on shutdown
15Jun99=======================================================================
1. added grepdbg program (so you can search your debug files and get times
and dates of incidents).
my $call;
my @out;
-if ($self->priv < 8) {
- return (1, $self->msg('e5'));
+if ($self->priv < 5) {
+ return (1, $self->msg('e5'));
}
foreach $call (@calls) {
- $call = uc $call;
- next if $call eq $main::mycall;
- my $dxchan = DXChannel->get($call);
- if ($dxchan) {
- if ($dxchan->is_ak1a) {
- $dxchan->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', $self->call)));
- } else {
- $dxchan->send_now('D', $self->msg('disc1', $self->call));
- }
- $dxchan->disconnect;
- push @out, $self->msg('disc2', $call);
- } else {
- push @out, $self->msg('e10', $call);
- }
+ $call = uc $call;
+ next if $call eq $main::mycall;
+ my $dxchan = DXChannel->get($call);
+ if ($dxchan) {
+ if ($dxchan->is_ak1a) {
+ $dxchan->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', $self->call)));
+ } else {
+ return (1, $self->msg('e5')) if $self->priv < 8;
+ $dxchan->send_now('D', $self->msg('disc1', $self->call));
+ }
+ $dxchan->disconnect;
+ push @out, $self->msg('disc2', $call);
+ } else {
+ push @out, $self->msg('e10', $call);
+ }
}
return (1, @out);
--- /dev/null
+#
+# reinit a cluster connection
+#
+my ($self, $line) = @_;
+my @calls = split /\s+/, $line;
+my $call;
+my @out;
+
+return (1, $self->msg('e5')) if $self->priv < 5;
+
+foreach $call (@calls) {
+ $call = uc $call;
+ next if $call eq $main::mycall;
+ my $dxchan = DXChannel->get($call);
+ if ($dxchan) {
+ if ($dxchan->is_ak1a) {
+
+ # first clear out any nodes on this dxchannel
+ my @gonenodes = map { $_->dxchan == $dxchan ? $_ : () } DXNode::get_all();
+ foreach my $node (@gonenodes) {
+ next if $dxchan == $DXProt::me;
+ DXProt::broadcast_ak1a(DXProt::pc21($node->call, 'Gone, re-init') , $dxchan) unless $dxchan->{isolate};
+ $node->del();
+ }
+ $dxchan->send(DXProt::pc38());
+ $dxchan->send(DXProt::pc18());
+ push @out, $self->msg('init1', $call);
+ }
+ } else {
+ push @out, $self->msg('e10', $call);
+ }
+}
+
+return (1, @out);
+
#
my $self = shift;
-return (1, $self->msg('e5')) if $self->priv < 9;
+return (1, $self->msg('e5')) if $self->priv < 6;
my $cmdline = shift;
my @f = split /\s+/, $cmdline;
#
sub print
{
- my $self = $DXLog::log;
+ my $fcb = $DXLog::log;
my $from = shift;
my $to = shift;
- my @date = $self->unixtoj(shift);
+ my @date = Julian::unixtojm(shift);
my $pattern = shift;
my $who = uc shift;
my $search;
my @in;
- my @out;
+ my @out = ();
my $eval;
my $count;
}
);
- $self->close; # close any open files
+ $fcb->close; # close any open files
- my $fh = $self->open(@date);
+ my $fh = $fcb->open(@date);
for ($count = 0; $count < $to; ) {
- my @spots = ();
+ my $ref;
if ($fh) {
+ @in = ();
while (<$fh>) {
chomp;
- push @in, [ split '\^' ];
+ $ref = [ split '\^' ];
+ push @{$ref}, "" unless @{$ref} >= 4;
+ push @in, $ref;
}
eval $eval; # do the search on this file
last if $count >= $to; # stop after n
return ("Log search error", $@) if $@;
}
- $fh = $self->openprev(); # get the next file
+ $fh = $fcb->openprev(); # get the next file
last if !$fh;
}
- return @out if defined @out;
+ return @out;
}
#
}
if ($pcno == 18) { # link request
+ $self->state('init');
+
+ # first clear out any nodes on this dxchannel
+ my @gonenodes = map { $_->dxchan == $self ? $_ : () } DXNode::get_all();
+ foreach my $node (@gonenodes) {
+ next if $node->dxchan == $DXProt::me;
+ broadcast_ak1a(pc21($node->call, 'Gone, re-init') , $self) unless $self->{isolate};
+ $node->del();
+ }
$self->send_local_config();
$self->send(pc20());
- $self->state('init');
return; # we don't pass these on
}
hnodee1 => 'Please enter your Home Node, set/homenode <your home DX Cluster>',
hnodee2 => 'Failed to set homenode on $_[0]',
hnode => 'Your Homenode is now \"$_[0]\"',
+ init1 => 'sent initialisation message to $_[0]',
iso => '$_[0] Isolated',
isou => '$_[0] UnIsolated',
isoc => '$_[0] created and Isolated',
Local::finish(); # end local processing
};
dbg('local', "Local::finish error $@") if $@;
-
+
+ # disconnect users
+ foreach $dxchan (DXChannel->get_all()) {
+ next if $dxchan->is_ak1a;
+ disconnect($dxchan) unless $dxchan == $DXProt::me;
+ }
+ Msg->event_loop(1, 0.05);
+ Msg->event_loop(1, 0.05);
+ Msg->event_loop(1, 0.05);
+ Msg->event_loop(1, 0.05);
+ Msg->event_loop(1, 0.05);
+ Msg->event_loop(1, 0.05);
+
+ # disconnect nodes
foreach $dxchan (DXChannel->get_all()) {
+ next unless $dxchan->is_ak1a;
disconnect($dxchan) unless $dxchan == $DXProt::me;
}
Msg->event_loop(1, 0.05);