Update to FreeBSD head 2018-04-01

Git mirror commit 8dfb1ccc26d1cea7e2529303003ff61f9f1784c4.

Update #3472.
This commit is contained in:
Sebastian Huber
2018-08-21 09:39:55 +02:00
parent 18fa92c2dc
commit 2df56dbd60
327 changed files with 6676 additions and 3502 deletions

View File

@@ -339,7 +339,7 @@ protopr(u_long off, const char *name, int af1, int proto)
"Proto", "Recv-Q", "Send-Q",
"Local Address", "Foreign Address");
if (!xflag && !Rflag)
xo_emit(" (state)");
xo_emit(" {T:/%-11.11s}", "(state)");
}
if (xflag) {
xo_emit(" {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} "
@@ -357,6 +357,8 @@ protopr(u_long off, const char *name, int af1, int proto)
xo_emit(" {T:/%8.8s} {T:/%5.5s}",
"flowid", "ftype");
}
if (Pflag)
xo_emit(" {T:/%s}", "Log ID");
xo_emit("\n");
#ifndef __rtems__
first = 0;
@@ -500,9 +502,9 @@ protopr(u_long off, const char *name, int af1, int proto)
}
if (istcp && !Lflag && !xflag && !Tflag && !Rflag) {
if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES)
xo_emit("{:tcp-state/%d}", tp->t_state);
xo_emit("{:tcp-state/%-11d}", tp->t_state);
else {
xo_emit("{:tcp-state/%s}",
xo_emit("{:tcp-state/%-11s}",
tcpstates[tp->t_state]);
#if defined(TF_NEEDSYN) && defined(TF_NEEDFIN)
/* Show T/TCP `hidden state' */
@@ -517,6 +519,9 @@ protopr(u_long off, const char *name, int af1, int proto)
inp->inp_flowid,
inp->inp_flowtype);
}
if (istcp && Pflag)
xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ?
"-" : tp->xt_logid);
xo_emit("\n");
xo_close_instance("socket");
}

View File

@@ -258,6 +258,7 @@ int mflag; /* show memory stats */
int noutputs = 0; /* how much outputs before we exit */
int numeric_addr; /* show addresses numerically */
int numeric_port; /* show ports numerically */
int Pflag; /* show TCP log ID */
static int pflag; /* show given protocol */
#ifndef __rtems__
static int Qflag; /* show netisr information */
@@ -329,7 +330,7 @@ main(int argc, char *argv[])
if (argc < 0)
exit(EXIT_FAILURE);
while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:np:Qq:RrSTsuWw:xz"))
while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:nPp:Qq:RrSTsuWw:xz"))
!= -1)
switch(ch) {
case '4':
@@ -431,6 +432,9 @@ main(int argc, char *argv[])
case 'n':
numeric_addr = numeric_port = 1;
break;
case 'P':
Pflag = 1;
break;
case 'p':
if ((tp = name2protox(optarg)) == NULL) {
xo_errx(1, "%s: unknown or uninstrumented "

View File

@@ -50,6 +50,7 @@ extern int mflag; /* show memory stats */
extern int noutputs; /* how much outputs before we exit */
extern int numeric_addr; /* show addresses numerically */
extern int numeric_port; /* show ports numerically */
extern int Pflag; /* show TCP log ID */
extern int rflag; /* show routing tables (or routing stats) */
extern int Rflag; /* show flowid / RSS information */
extern int sflag; /* show protocol statistics */

View File

@@ -9,6 +9,7 @@
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_netstat, extern char *interface);
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_netstat, extern int Aflag);
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_netstat, extern int Lflag);
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_netstat, extern int Pflag);
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_netstat, extern int Rflag);
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_netstat, extern int Tflag);
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_netstat, extern int Wflag);

View File

@@ -29,6 +29,7 @@
/* main.c */
#define Aflag _bsd_netstat_Aflag
#define Lflag _bsd_netstat_Lflag
#define Pflag _bsd_netstat_Pflag
#define Rflag _bsd_netstat_Rflag
#define Tflag _bsd_netstat_Tflag
#define Wflag _bsd_netstat_Wflag