use Route::Node;
use Script;
use DXProtHandle;
+use DXCIDR;
use Time::HiRes qw(gettimeofday tv_interval);
use DXSubprocess;
%pc92_find $pc92_find_timeout $pc92_short_update_period
$next_pc92_obs_timeout $pc92_slug_changes $last_pc92_slug
$pc92_extnode_update_period $pc50_interval
- $pc92_keepalive_period $senderverify
+ $pc92_keepalive_period $senderverify $pc92_ad_enabled
+ $pc92c_ipaddr_enable
);
$pc11_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc11
%pc92_find = (); # outstanding pc92 find operations
$pc92_find_timeout = 30; # maximum time to wait for a reply
$senderverify = 0; # 1 = check spotter is on node it says it is and check ip address if available
- # 2 = do 1 and dump if check
-
+; # 2 = do 1 and dump if check
+$pc92_ad_enabled = 1; # send pc92 A & D records.
+$pc92c_ipaddr_enable = 0; # add the local ip address info to each callsign in a PC92 C
@checklist =
(
# log it
my $host = $self->{conn}->peerhost;
$host ||= "AGW Port #$self->{conn}->{agwport}" if exists $self->{conn}->{agwport};
+ $host ||= $host if is_ipaddr($host);
$host ||= "unknown";
$self->{hostname} = $host if is_ipaddr($host);
-
Log('DXProt', "$call connected from $host");
# remember type of connection
}
}
+ my $origin = $self->{call};
+
if (defined &Local::pcprot) {
my $r;
- eval { $r = Local::pcprot($self, $pcno, $line, @field); };
+ eval { $r = Local::pcprot($self, $pcno, $line, $origin, \@field); };
return if $r; # i.e don't process it
}
# send it out for processing
- my $origin = $self->{call};
no strict 'subs';
my $sub = "handle_$pcno";
{
my $pcno = shift;
my $hops = $DXProt::hopcount{$pcno};
- $hops = $DXProt::def_hopcount if !$hops;
+ $hops = $DXProt::def_hopcount unless $hops;
return "H$hops";
}
my $fc = DXSubprocess->new;
# just behave normally if something has set the "one-shot" _nospawn in the channel
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
eval { @out = $cmdref->(@$args); };
if ($@) {
DXDebug::dbgprintring(25);
{
my ($self, $from, $to, $via, $line, $origin) = @_;
+ my $ipaddr = DXCommandmode::alias_localhost($self->hostname || '127.0.0.1');
if ($self->{do_pc9x}) {
- $self->send(pc93($to, $from, $via, $line));
+ $self->send(pc93($to, $from, $via, $line, undef, $ipaddr));
} else {
$self->send(pc10($from, $to, $via, $line, $origin));
}
- Log('talk', $to, $from, '>' . ($via || $origin || $self->call), $line) unless $origin && $origin ne $main::mycall;
+ Log('talk', $to, $from, '>' . ($via || $origin || $self->call), $line, $ipaddr) unless $origin && $origin ne $main::mycall;
}
# send it if it isn't the except list and isn't isolated and still has a hop count
my $self = shift;
my $origin = shift;
my $line = shift;
+
broadcast_route_pc9x($self, $origin, \&pc92c, $line, 1, @_);
}
my $self = shift;
my $origin = shift;
my $line = shift;
+ return unless $pc92_ad_enabled;
broadcast_route_pc9x($self, $origin, \&pc92a, $line, 1, @_);
}
my $self = shift;
my $origin = shift;
my $line = shift;
+ return unless $pc92_ad_enabled;
broadcast_route_pc9x($self, $origin, \&pc92d, $line, 1, @_);
}
$via = '*' if $target eq 'ALL' || $target eq 'SYSOP';
Log('ann', $target, $main::mycall, $text);
AnnTalk::add_anncache('ann', $target, $main::mycall, $text);
-
- $main::me->normal(DXProt::pc93($target, $main::mycall, $via, $text));
+ my $ipaddr = DXCommandmode::alias_localhost($main::me->hostname || '127.0.0.1');
+ $main::me->normal(DXProt::pc93($target, $main::mycall, $via, $text, undef, $ipaddr));
} else {
DXCommandmode::send_chats($main::me, $target, $text);
}