--- /dev/null	Mon Nov 23 13:45:09 2015
+++ new/usr/src/man/man1m/flowstat.1m	Mon Nov 23 13:45:09 2015
@@ -0,0 +1,464 @@
+'\" te
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source.  A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2015 William Dowling <wmdowling@gmail.com>
+.\"
+.TH FLOWSTAT 1M "Nov 12, 2015"
+.SH NAME
+flowstat \- display bandwidth statistics for a single flow, or all flows, 
+on a link created by \fBflowadm\fR(1M)
+.SH SYNOPSIS
+.LP
+.nf
+\fBflowstat [\fB-r\fR | \fB-t\fR] [\fB-i\fR \fIinterval\fR]] [\fB-l\fR \fIlink\fR] [\fIflow\fR]
+.fi
+
+.LP
+.nf
+\fBflowstat [\fB-p\fR | \fB-u\fR \fIR|K|M|G|T|P\fR] [\fB-o\fR \fIfield[,...]\fR] [\fB-l\fR \fIlink\fR] [\fIflow\fR]
+.fi
+
+.LP
+.nf
+\fBflowstat [\fB-A\fR] [\fB-l\fR \fIlink\fR] [\fIflow\fR]
+.fi
+
+.LP
+.nf
+\fBflowstat [\fB-S\fR] [\fB-i\fR \fIinterval\fR] [\fB-l\fR \fIlink\fR] [\fIflow\fR]
+.fi
+
+.LP
+.nf
+\fBflowstat -h\fR [\fB-a\fR] [\fB-d\fR] [\fB-F\fR \fIformat\fR] [\fB-s\fR \fI<DD/MM/YYYY,HH:MM:SS>\fR]
+     [\fB-e\fR \fI<DD/MM/YYYY,HH:MM:SS>\fR] [\fB-f\fR \fI<logfile>\fR] [\fIflow\fR]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBflowstat\fR command displays bandwidth statistics on flows created using
+\fBflowadm\fR(1M). This information includes packets received and transmitted,
+bytes received and transmitted, and errors received and transmitted.
+.sp
+
+.SS "Options"
+.LP
+Each \fBflowstat\fR subcommand has its own set of options. However, many of the 
+subcommands have the following as a common option:
+.sp
+.ne 2
+.na
+[\fB\fB-l\fR \fIlink\fR] [\fIflow\fR\fR]
+.sp
+.ad
+.sp .6
+.RS 4n
+\fIlink\fR refers to a physical or virtual interface while \fIflow\fR refers to a network
+bandwidth resource created using \fBflowadm\fR(1M). If a link is specified without a flow, the data returned
+will be for all flows active on the link. If a flow is specified without a link, the
+data will be returned if the flow is found active on any link. \fIflow\fR names
+must be unique across all active links.
+.RE
+
+.SH SUB-COMMANDS
+.sp
+.LP
+The flowstat command may be invoked in the following ways:
+.sp
+.ne 2
+.na
+\fB\fBflowstat\fR [\fB-?\fR]
+.ad
+.sp .6
+.RS 4n
+Display a usage message.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBflowstat\fR [\fB-r\fR | \fB-t\fR] [\fB-i\fR \fIinterval\fR] [\fB-l\fR \fIlink\fR] [\fIflow\fR]
+.ad
+.sp .6
+.RS 4n
+Display received or transmitted packets on a specified link or flow with an optional
+interval. If no flow is specified, statistics for all flows will be displayed. Output
+is sorted in descending order of flow utilization.
+
+.sp
+.ne 2
+.na
+\fB\fB-r\fR
+.ad
+.sp .6
+.RS 4n
+Display receive-side packet statistics which includes the amount of packets received,
+bytes received, and errors encountered.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-t\fR
+.ad
+.sp .6
+.RS 4n
+Display transmit-side packet statistics which includes the amount of packets transmitted,
+bytes transmitted, and errors encountered.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-i \fIinterval\fR
+.ad
+.sp .6
+.RS 4n
+Specify an interval in seconds to refresh statistics. The default interval is one second.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBflowstat\fR [\fB-p\fR | \fB-u\fR \fIR|K|M|G|T|P\fR] [\fB-o\fR \fIfield[,...]\fR] [\fB-l\fR
+\fIlink\fR] [\fIflow\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Display some or all of the flow statistics in a particular format. Note that if \fB-p\fR is specified
+then \fB-o\fR is required.
+.sp
+.ne 2
+.na
+\fB\fB-p\fR\fR
+.ad
+.sp .6
+.RS 4n
+The output is displayed in a machine-parseable format.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-u\fR \fIR|K|M|G|T|P\fR
+.ad
+.sp .6
+.RS 4n
+Display the statistics in a chosen unit. One of (R)aw Numbers, (K)ilobits,
+(M)egabits, (G)igabits, (T)erabits or (P)etabits.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-o\fR \fIfield[,...]\fR
+.ad
+.sp .6
+.RS 4n
+Display a list of output fields which must be comma separated. Valid fields
+are listed below.
+.RE
+
+.sp .6
+.RS 4n
+List of supported RX fields:
+.RS 4n
+.in +6
+.nf
+.IP \fBflow\fR
+\The name of the flow that is currently active on
+a link.
+.IP \fBrbytes\fR
+\The total number of bytes received on a flow or
+a link if a flow is not specified.
+.IP \fBipkts\fR
+\The total number of packets received on a flow
+or a link if a flow is not specified.
+.IP \fBierrs\fR
+\The total number of errors seen on the a link
+or flow while receiving data.
+.fi
+.in -6
+.ad
+.RE
+
+.sp .6
+List of supported TX fields:
+.RS 4n
+.in +6
+.nf
+.IP \fBflow\fR
+\The name of the flow that is currently active on
+a link.
+.IP \fBobytes\fR
+\The total number of bytes transmitted on a flow
+or a link if a flow is not specified.
+.IP \fBopkts\fR
+\The total number of packets transmitted on a
+flow or a link if a flow is not specified.
+.IP \fBoerrs\fR
+\The total number of errors seen on a link or
+flow while transmitting data.
+.fi
+.in -6
+.ad
+.RE
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBflowstat\fR \fB-A\fR [\fB-l\fR \fIlink\fR] [\fIflow\fR\fR]
+.ad
+.sp .6
+.RS 4n
+Display all statistics for a single flow, or all flows if none is specified.
+.RE
+
+.sp
+.ne 2
+.RS 4n
+\fB\fB-A\fR
+.ad
+.sp .6
+.RS 4n
+Display all statistical information for the flow specified or all flows.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBflowstat\fR \fB-S\fR [\fB-i\fR \fIinterval\fR] [\fB-l\fR \fIlink\fR]
+[\fIflow\fR\fR]
+.ad
+.sp .6
+.RS 4n
+Display a continuously updated real-time view of statistics from the link or flow.
+.sp
+.ne 2
+.na
+\fB\fB-S\fR
+.ad
+.sp .6
+.RS 4n
+Display updated statistics in a dynamic real-time view of an active link or flow.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-i\fR \fIinterval\fR
+.ad
+.sp .6
+.RS 4n
+Specify an interval in seconds to refresh statistics. The default interval is one
+second.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBflowstat\fR \fB-h\fR [\fB-a\fR] [\fB-d\fR] [\fB-F\fR \fIformat\fR]
+[\fB-s\fR \fI<DD/MM/YYYY,HH:MM:SS>\fR]
+[\fB-e\fR \fI<DD/MM/YYYY,HH:MM:SS>\fR] [\fB-f\fR \fIlogfile\fR] [\fIflow\fR] 
+.ad
+.sp .6
+.RS 4n
+Display historical statistical information for a single flow, or all flows if
+none is specified.
+.sp
+.ne 2
+.na
+\fB\fB-h\fR\fR
+.ad
+.sp .6
+.RS 4n
+Use historical information generated from extended accounting. This option
+must be used with the \fB-f\fR option to specify the logfile where the historical
+data is written to. See \fBacctadm\fR(1M) for information on enabling extended 
+accounting.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-a\fR\fR
+.ad
+.sp .6
+.RS 4n
+Displays all historical network usage. The only works once extended
+accounting is enabled. It includes usage information for the flows that
+have already been deleted.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-d\fR\fR
+.ad
+.sp .6
+.RS 4n
+Display dates where logging information exists in the format MM/DD/YYYY.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-F\fR \fIformat\fR\fR
+.ad
+.sp .6
+.RS 4n
+Displays the network flow usage in a format specified. The only format
+currently supported is gnuplot.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-s\fR \fIstarttime\fR
+.ad
+.sp .6
+.RS 4n
+Define the start-time for which to display flow data which is of the format \fIYYYY\fR.\fIMM\fR.\fIDD\fR,\fIhh\fR:\fImm\fR:\fIss\fR.
+This option must be used with \fB-e\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-e\fR \fIendtime\fR\fR
+.ad
+.sp .6
+.RS 4n
+Define the end-time for which to display flow data which is of the format \fIYYYY\fR.\fIMM\fR.\fIDD\fR,\fIhh\fR:\fImm\fR:\fIss\fR.
+This option must be used with \fB-s\fR.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-f\fR \fIlogfile\fR\fR
+.ad
+.sp .6
+.RS 4n
+The \fIlogfile\fR contains flow data captured from enabling extended accounting
+using \fBacctadm\fR(1M).
+.RE
+
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRDisplay received packets on a particular flow
+.sp
+.LP
+The command below displays received packet data for the flow \fBssh-1\fR
+on the link \fBe1000g0\fR over an interval of 2 seconds.
+
+.sp
+.in +2
+.nf
+# \fBflowstat -r -i 2 -l e1000g0 ssh-1\fR
+         FLOW    IPKTS   RBYTES    IERRS
+        ssh-1      382   32.10K        0
+        ssh-1        3      202        0
+.fi
+.in -2
+.sp
+
+.LP
+\fBExample 2 \fRDisplay all statistics for a particular flow.
+.sp
+.LP
+The following command displays all statistics available for the flow \fBssh-1\fR
+on the link \fBe1000g0\fR.
+
+.sp
+.in +2
+.nf
+# \fBflowstat -A -l e1000g0 ssh-1\fR
+ssh-1
+             ipackets             766
+               rbytes           64474
+             opackets             464
+               obytes           56516
+.fi
+.in -2
+.sp
+
+.LP
+\fBExample 3 \fRDisplay historical flow statistics.
+.sp
+.LP
+The following command displays flow statistics captured when using the 
+extended accounting facility \fBacctadm\fR(1M).
+
+.sp
+.in +2
+.nf
+# \fBflowstat -h -a -s 11/06/2015,16:02:51 -e 11/06/2015,16:04:31 \e
+-f /var/adm/acct/flowlog.log \fR
+FLOW         START         END           RBYTES   OBYTES   BANDWIDTH
+ssh-1        16:02:51      16:03:11      0        0            0 Mbps
+ssh-1        16:03:11      16:03:31      0        0            0 Mbps
+ssh-1        16:03:31      16:03:51      756      876          0 Mbps
+ssh-1        16:03:51      16:04:11      0        0            0 Mbps
+ssh-1        16:04:11      16:04:31      5564     3228     0.003 Mbps
+
+.fi
+.in -2
+.sp
+
+.LP
+.SH EXIT STATUS
+.sp
+.ne 2
+.na
+\fB\fB0\fR\fR
+.ad
+.sp .6
+.RS 4n
+All actions were performed successfully.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB>0\fR\fR
+.ad
+.sp .6
+.RS 4n
+An error occurred.
+.RE
+
+.SH STABILITY
+.sp
+.LP
+.sp
+The invocation is committed. The output of the command is
+Not-an-Interface; however, the machine-parseable output of the command
+is committed.
+
+.SH SEE ALSO
+.sp
+.LP
+\fBacctadm\fR(1M), \fBdladm\fR(1M), \fBflowadm\fR(1M), \fBifconfig\fR(1M), \fBprstat\fR(1M),
+\fBroute\fR(1M), \fBattributes\fR(5), \fBdlpi\fR(7P)
