X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconnect.pl;fp=cmd%2Fshow%2Fconnect.pl;h=708113769fbb74008d17b6c8c493efd4909233ef;hb=70928ea2832755c4bcd8f4d04fc0acc3861a4496;hp=0000000000000000000000000000000000000000;hpb=61660841afb3901002602e4956f09de5567bc950;p=spider.git diff --git a/cmd/show/connect.pl b/cmd/show/connect.pl new file mode 100644 index 00000000..70811376 --- /dev/null +++ b/cmd/show/connect.pl @@ -0,0 +1,32 @@ +# +# show active connections +# +# Copyright (c) 2001 Dirk Koopman G1TLH +# +# $Id$ +# + +my $self = shift; +return (1, $self->msg('e5')) if $self->priv < 1; +my @out; +my $count; + +push @out, "Cnum Call Address/Port State Type Dir."; + +foreach my $call (sort keys %Msg::conns) { + my $r = $Msg::conns{$call}; + my $addr = "$r->{peerhost}/$r->{peerport}"; + my $c = $call; + if ($c =~ /^Server\s+(\S+)$/) { + $addr = $1; + $c = "Server"; + } + push @out, sprintf(" %3d %-9s %-27.27s %3s %7s %8s", + $r->{cnum}, $c, + $addr, $r->{state}, + $r->{csort}, $r->{sort}); + + $count++; +} +push @out, "$count Connections"; +return (1, @out);