mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 08:37:41 +08:00
Update to FreeBSD head 2018-04-01
Git mirror commit 8dfb1ccc26d1cea7e2529303003ff61f9f1784c4. Update #3472.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
@@ -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 "
|
||||
|
@@ -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 */
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
@@ -1366,7 +1366,7 @@ print_intrcnts(unsigned long *intrcnts, unsigned long *old_intrcnts,
|
||||
for (i = 0, intrcnt=intrcnts, old_intrcnt=old_intrcnts; i < nintr; i++) {
|
||||
if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) {
|
||||
count = *intrcnt - *old_intrcnt;
|
||||
rate = (count * 1000 + period_ms / 2) / period_ms;
|
||||
rate = ((uint64_t)count * 1000 + period_ms / 2) / period_ms;
|
||||
xo_open_instance("interrupt");
|
||||
xo_emit("{d:name/%-*s}{ket:name/%s} "
|
||||
"{:total/%20lu} {:rate/%10lu}\n",
|
||||
|
Reference in New Issue
Block a user