Commit 19a5ae6f authored by Phil Blundell's avatar Phil Blundell

Add support for `-V' to slattach and plipconfig

Add support for netstat --groups, from Tuan Hoang.
Add support for netstat --programs, from Jan Kratochvil
Don't delete .pot files when making clean in po/
Bump VERSION to 1.51
parent 4adb3879
...@@ -92,7 +92,7 @@ RESLIB = # -L/usr/inet6/lib -linet6 ...@@ -92,7 +92,7 @@ RESLIB = # -L/usr/inet6/lib -linet6
# -------- end of user definitions -------- # -------- end of user definitions --------
MAINTAINER = Philip.Blundell@pobox.com MAINTAINER = Philip.Blundell@pobox.com
RELEASE = 1.50 RELEASE = 1.51
.EXPORT_ALL_VARIABLES: .EXPORT_ALL_VARIABLES:
......
...@@ -28,7 +28,15 @@ Contents: ...@@ -28,7 +28,15 @@ Contents:
Notes Notes
----- -----
This is net-tools 1.50. Notable changes since 1.49 include: This is net-tools 1.51. Notable changes since 1.50 include:
- a compilation problem with 2.0 kernels has been fixed
- Tuan Hoang added support to netstat for printing multicast group
information (option --groups)
- Jan Kratochvil added support to netstat for displaying details of
the process owning a socket (option --programs)
Notable changes since 1.49 include:
- netstat supports a new option `--listening' to show only listening - netstat supports a new option `--listening' to show only listening
sockets. sockets.
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
*/ */
/* pathnames of the procfs files used by NET. */ /* pathnames of the procfs files used by NET. */
#define _PATH_PROCNET_IGMP "/proc/net/igmp"
#define _PATH_PROCNET_IGMP6 "/proc/net/igmp6"
#define _PATH_PROCNET_TCP "/proc/net/tcp" #define _PATH_PROCNET_TCP "/proc/net/tcp"
#define _PATH_PROCNET_TCP6 "/proc/net/tcp6" #define _PATH_PROCNET_TCP6 "/proc/net/tcp6"
#define _PATH_PROCNET_UDP "/proc/net/udp" #define _PATH_PROCNET_UDP "/proc/net/udp"
......
...@@ -39,7 +39,7 @@ netstat \- Display network connections, routing tables, interface statistics, ma ...@@ -39,7 +39,7 @@ netstat \- Display network connections, routing tables, interface statistics, ma
.PP .PP
.B netstat .B netstat
.RB [ \-veenac ] .RB [ \-veenpac ]
.RB { \-\-interfaces | \-i } .RB { \-\-interfaces | \-i }
.RI [ iface ] .RI [ iface ]
...@@ -77,7 +77,9 @@ you get some additional informations (userid). With the ...@@ -77,7 +77,9 @@ you get some additional informations (userid). With the
switch you can make netstat complain about known address families which are switch you can make netstat complain about known address families which are
not supported by the kernel. The not supported by the kernel. The
.B -o .B -o
option displays some additional information on networking timers. option displays some additional information on networking timers. Enabling the
.B -p
will show you the process PID and name of the program holding the socket.
.B -a .B -a
print all sockets, including the listening server sockets. The address print all sockets, including the listening server sockets. The address
family family
...@@ -143,6 +145,13 @@ usefull informations about unconfigured address families. ...@@ -143,6 +145,13 @@ usefull informations about unconfigured address families.
shows numerical addresses instead of trying to determine symbolic host, port shows numerical addresses instead of trying to determine symbolic host, port
or user names. or user names.
.SS "\-p, \-\-programs"
displays process name and PID of the owner of each socket it dumps. You
have to be the owner of such process to have all it's sockets matched to it
or generally
.B root
user will see all the necessary information in place.
.SS "\-A, \-\-af \fIfamily\fI" .SS "\-A, \-\-af \fIfamily\fI"
use a different method to set the address families. use a different method to set the address families.
.I family .I family
...@@ -260,6 +269,16 @@ The state of the socket is unknown. ...@@ -260,6 +269,16 @@ The state of the socket is unknown.
.SS "User" .SS "User"
The name or the UID of the owner of the socket. The name or the UID of the owner of the socket.
.SS "PID/Program name"
Slash-separated pair of the PID and process name of the program holding
this socket. Option
.B -p
enables display of this column. You will also need
.B root
privileges as you have to have access rights to process to be able to see
the program's sockets matched up to it. This identification information
is not yet available for IPX sockets.
.SS "Timer" .SS "Timer"
(this needs to be written) (this needs to be written)
...@@ -352,6 +371,11 @@ The socket is not connected to another one. ...@@ -352,6 +371,11 @@ The socket is not connected to another one.
UNKNOWN UNKNOWN
This state should never happen. This state should never happen.
.SS "PID/Program name"
PID and process name of the program holding this socket. More info available in
.B "Active Internet connections"
section written above.
.SS "Path" .SS "Path"
This displays the path name as which the corresponding processes attached This displays the path name as which the corresponding processes attached
to the socket. to the socket.
......
This diff is collapsed.
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
#include "config.h" #include "config.h"
#include "intl.h" #include "intl.h"
#include "net-support.h"
#include "version.h"
int opt_a = 0; int opt_a = 0;
int opt_i = 0; int opt_i = 0;
int opt_v = 0; int opt_v = 0;
...@@ -48,10 +51,21 @@ int skfd = -1; ...@@ -48,10 +51,21 @@ int skfd = -1;
struct ifreq ifr; struct ifreq ifr;
struct plipconf *plip; struct plipconf *plip;
char *Release = RELEASE,
*Version = "plipconfig 0.2",
*Signature = "John Paul Morrison, Alan Cox et al.";
static void version(void)
{
printf("%s\n%s\n%s\n", Release, Version, Signature);
exit(E_VERSION);
}
void usage(void) void usage(void)
{ {
fprintf(stderr, _("Usage: plipconfig [-a] [-i] [-v] interface\n")); fprintf(stderr, _("Usage: plipconfig [-a] [-i] [-v] interface\n"));
fprintf(stderr, _(" [nibble NN] [trigger NN]\n")); fprintf(stderr, _(" [nibble NN] [trigger NN]\n"));
fprintf(stderr, _(" plipconfig -V\n"));
exit(-1); exit(-1);
} }
...@@ -77,6 +91,8 @@ int main(int argc, char **argv) ...@@ -77,6 +91,8 @@ int main(int argc, char **argv)
opt_a = 1; opt_a = 1;
if (!strcmp(*argv, "-v")) if (!strcmp(*argv, "-v"))
opt_v = 1; opt_v = 1;
if (!strcmp(*argv, "-V"))
version();
argv++; argv++;
argc--; argc--;
} }
......
...@@ -51,7 +51,7 @@ update-po: Makefile ...@@ -51,7 +51,7 @@ update-po: Makefile
done done
clean: clean:
rm -f *mo $(NLSPACKAGE).pot rm -f *mo
distclean: clean distclean: clean
rm -f .depend Makefile rm -f .depend Makefile
......
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
char *Release = RELEASE, char *Release = RELEASE,
*Version = "@(#) slattach 1.1.91 (12-Feb-95)"; *Version = "@(#) slattach 1.1.91 (12-Feb-95)",
*Signature = "Fred N. van Kempen et al.";
struct { struct {
...@@ -541,13 +542,22 @@ usage(void) ...@@ -541,13 +542,22 @@ usage(void)
#ifdef SIOCSOUTFILL #ifdef SIOCSOUTFILL
"[-o outfill] " "[-o outfill] "
#endif #endif
"[-c cmd] [-s speed] [-p protocol] tty | -\n"; "[-c cmd] [-s speed] [-p protocol] tty | -\n"
" slattach -V\n";
fprintf(stderr, usage_msg); fprintf(stderr, usage_msg);
exit(1); exit(1);
} }
static void
version(void)
{
printf("%s\n%s\n%s\n", Release, Version, Signature);
exit(E_VERSION);
}
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
...@@ -564,7 +574,7 @@ main(int argc, char *argv[]) ...@@ -564,7 +574,7 @@ main(int argc, char *argv[])
/* Scan command line for any arguments. */ /* Scan command line for any arguments. */
opterr = 0; opterr = 0;
while ((s = getopt(argc, argv, "c:ehlLmnp:qs:vd" while ((s = getopt(argc, argv, "c:ehlLmnp:qs:vdV"
#ifdef SIOCSKEEPALIVE #ifdef SIOCSKEEPALIVE
"k:" "k:"
#endif #endif
...@@ -632,8 +642,13 @@ main(int argc, char *argv[]) ...@@ -632,8 +642,13 @@ main(int argc, char *argv[])
opt_v = 1 - opt_v; opt_v = 1 - opt_v;
break; break;
case 'V':
version();
/*NOTREACHED*/
default: default:
usage(); usage();
/*NOTREACHED*/
} }
activate_init(); activate_init();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment