add show/connect
authorminima <minima>
Sun, 15 Apr 2001 16:55:44 +0000 (16:55 +0000)
committerminima <minima>
Sun, 15 Apr 2001 16:55:44 +0000 (16:55 +0000)
Changes
cmd/Commands_en.hlp
cmd/show/connect.pl [new file with mode: 0644]

diff --git a/Changes b/Changes
index 81a2098b8be82d4e3ab18de45f7af59d943e10af..c6d49fa68fd5d4f6c812f9749ba7f500322d584b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 15Apr01=======================================================================
 1. made some mods to the sgml documentation for 1.47
+2. added show/connect command
 11Apr01=======================================================================
 1. fixed more of the "xxx disappeared from yyy" messages
 2. altered the build no logic so that it always checksums the same files
index 877180e6deb0f54a35a4f1ca72776d79b2134293..af5bcbd92179b607b01403728378d587f98504fa 100644 (file)
@@ -1194,6 +1194,21 @@ for more information.
 Display all the bad spotter's callsigns in the system, see SET/BADSPOTTER
 for more information.
 
+=== 0^SHOW/CONFIGURATION [<node>]^Show all the nodes and users visible
+This command allows you to see all the users that can be seen
+and the nodes to which they are connected.
+
+This command is normally abbreviated to: sh/c
+
+BE WARNED: the list that is returned can be VERY long
+
+=== 0^SHOW/CONFIGURATION/NODE^Show all the nodes connected locally
+Show all the nodes connected to this node.
+
+=== 1^SHOW/CONNECT^Show all the active connections
+This command shows information on all the active connections known to
+the node. This command gives slightly more information than WHO.
+
 === 0^SHOW/DATE [<prefix>|<callsign>]^Show the local time 
 This is very nearly the same as SHOW/TIME, the only difference the format
 of the date string if no arguments are given.
diff --git a/cmd/show/connect.pl b/cmd/show/connect.pl
new file mode 100644 (file)
index 0000000..7081137
--- /dev/null
@@ -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);