X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FMsg.pm;h=f2bb29768169b02b953887dcc6395a42d7b7175d;hb=fc55b5fa75140c8335137662a7be6e50b89cf183;hp=c9b58a482cb19398d9e94cc3cf471e3f69bb801d;hpb=e1d5c2a325cb6b8674eab55c23f12445aae01f52;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index c9b58a48..f2bb2976 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -193,10 +193,19 @@ sub pid_gone } } +sub ax25 +{ + my $conn = shift; + return $conn->{csort} eq 'ax25'; +} + sub peerhost { - my $self = shift; - return $self->{peerhost}; + my $conn = shift; + $conn->{peerhost} ||= 'ax25' if $conn->ax25; + $conn->{peerhost} ||= $conn->{sock}->peerhost if $conn->{sock} && $conn->{sock}->isa('IO::Socket::INET'); + $conn->{peerhost} ||= 'UNKNOWN'; + return $conn->{peerhost}; } #-----------------------------------------------------------------