View | Details | Raw Unified | Return to bug 20681
Collapse All | Expand All

(-)mysrc/usr.bin/netstat/inet.c (-1 / +1 lines)
Lines 695-701 Link Here
695
695
696
	sprintf(line, "%.*s.", (Aflag && !numeric) ? 12 : 16, inetname(in));
696
	sprintf(line, "%.*s.", (Aflag && !numeric) ? 12 : 16, inetname(in));
697
	cp = index(line, '\0');
697
	cp = index(line, '\0');
698
	if (!numeric && port)
698
	if ((Sflag || !numeric) && port)
699
		sp = getservbyport((int)port, proto);
699
		sp = getservbyport((int)port, proto);
700
	if (sp || port == 0)
700
	if (sp || port == 0)
701
		sprintf(cp, "%.15s", sp ? sp->s_name : "*");
701
		sprintf(cp, "%.15s", sp ? sp->s_name : "*");
(-)mysrc/usr.bin/netstat/inet6.c (-1 / +1 lines)
Lines 992-998 Link Here
992
	sprintf(line, "%.*s.", lflag ? 39 :
992
	sprintf(line, "%.*s.", lflag ? 39 :
993
		(Aflag && !numeric) ? 12 : 16, inet6name(in6));
993
		(Aflag && !numeric) ? 12 : 16, inet6name(in6));
994
	cp = index(line, '\0');
994
	cp = index(line, '\0');
995
	if (!numeric && port)
995
	if ((Sflag || !numeric) && port)
996
		GETSERVBYPORT6(port, proto, sp);
996
		GETSERVBYPORT6(port, proto, sp);
997
	if (sp || port == 0)
997
	if (sp || port == 0)
998
		sprintf(cp, "%.8s", sp ? sp->s_name : "*");
998
		sprintf(cp, "%.8s", sp ? sp->s_name : "*");
(-)mysrc/usr.bin/netstat/iso.c (-1 / +1 lines)
Lines 435-441 Link Here
435
435
436
	*cp++ = '.';
436
	*cp++ = '.';
437
	if(sufxlen) {
437
	if(sufxlen) {
438
		if( !Aflag && !nflag && (ihe=iso_getserventrybytsel(sufx, sufxlen))) {
438
		if( !Aflag && (Sflag || !nflag) && (ihe=iso_getserventrybytsel(sufx, sufxlen))) {
439
			Ihe = *ihe;
439
			Ihe = *ihe;
440
			ihe = &Ihe;
440
			ihe = &Ihe;
441
		}
441
		}
(-)mysrc/usr.bin/netstat/main.c (-3 / +6 lines)
Lines 302-308 Link Here
302
302
303
	af = AF_UNSPEC;
303
	af = AF_UNSPEC;
304
304
305
	while ((ch = getopt(argc, argv, "Aabdf:ghI:lLiM:mN:np:rstuw:")) != -1)
305
	while ((ch = getopt(argc, argv, "Aabdf:ghI:lLiM:mN:np:rSstuw:")) != -1)
306
		switch(ch) {
306
		switch(ch) {
307
		case 'A':
307
		case 'A':
308
			Aflag = 1;
308
			Aflag = 1;
Lines 393-398 Link Here
393
		case 'r':
393
		case 'r':
394
			rflag = 1;
394
			rflag = 1;
395
			break;
395
			break;
396
		case 'S':
397
			Sflag = 1;
398
			break;
396
		case 's':
399
		case 's':
397
			++sflag;
400
			++sflag;
398
			break;
401
			break;
Lines 696-703 Link Here
696
usage()
699
usage()
697
{
700
{
698
	(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
701
	(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
699
"usage: netstat [-AaLln] [-f address_family] [-M core] [-N system]",
702
"usage: netstat [-AaLlnS] [-f address_family] [-M core] [-N system]",
700
"       netstat [-abdghilmnrs] [-f address_family] [-M core] [-N system]",
703
"       netstat [-abdghilmnrSs] [-f address_family] [-M core] [-N system]",
701
"       netstat [-bdn] [-I interface] [-M core] [-N system] [-w wait]",
704
"       netstat [-bdn] [-I interface] [-M core] [-N system] [-w wait]",
702
"       netstat [-M core] [-N system] [-p protocol]");
705
"       netstat [-M core] [-N system] [-p protocol]");
703
	exit(1);
706
	exit(1);
(-)mysrc/usr.bin/netstat/netstat.1 (+4 lines)
Lines 235-240 Link Here
235
The program will complain if
235
The program will complain if
236
.Ar protocol
236
.Ar protocol
237
is unknown or if there is no statistics routine for it.
237
is unknown or if there is no statistics routine for it.
238
.It Fl S
239
Show service names even if numeric output has been requested by the
240
.Fl n
241
option.
238
.It Fl s
242
.It Fl s
239
Show per-protocol statistics.
243
Show per-protocol statistics.
240
If this option is repeated, counters with a value of zero are suppressed.
244
If this option is repeated, counters with a value of zero are suppressed.
(-)mysrc/usr.bin/netstat/netstat.h (+1 lines)
Lines 48-53 Link Here
48
int	nflag;		/* show addresses numerically */
48
int	nflag;		/* show addresses numerically */
49
int	pflag;		/* show given protocol */
49
int	pflag;		/* show given protocol */
50
int	rflag;		/* show routing tables (or routing stats) */
50
int	rflag;		/* show routing tables (or routing stats) */
51
int	Sflag;		/* show service names even if -n specified */
51
int	sflag;		/* show protocol statistics */
52
int	sflag;		/* show protocol statistics */
52
int	tflag;		/* show i/f watchdog timers */
53
int	tflag;		/* show i/f watchdog timers */
53
54
(-)mysrc/usr.bin/sockstat/sockstat.pl (-1 / +1 lines)
Lines 40-46 Link Here
40
$user,   $cmd,    $pid, $fd, $proto,$laddr,               $faddr
40
$user,   $cmd,    $pid, $fd, $proto,$laddr,               $faddr
41
.
41
.
42
42
43
open NETSTAT, "netstat -Aan |" or die "'netstat' failed: $!";
43
open NETSTAT, "netstat -AanS |" or die "'netstat' failed: $!";
44
<NETSTAT>; <NETSTAT>;
44
<NETSTAT>; <NETSTAT>;
45
45
46
while (<NETSTAT>) {
46
while (<NETSTAT>) {

Return to bug 20681