Print this page
11547 Want connstat(1M) command to display per-connection TCP statistics
Portions contributed by: Cody Peter Mello <cody.mello@joyent.com>
Portions contributed by: Ahmed G <ahmedg@delphix.com>
Reviewed by: Jason King <jason.king@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/mib2.h
          +++ new/usr/src/uts/common/inet/mib2.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   *
  21   21   * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  22   22   */
  23      -/* Copyright (c) 1990 Mentat Inc. */
       23 +/*
       24 + * Copyright (c) 1990 Mentat Inc.
       25 + * Copyright (c) 2015, 2016 by Delphix. All rights reserved.
       26 + */
  24   27  
  25   28  #ifndef _INET_MIB2_H
  26   29  #define _INET_MIB2_H
  27   30  
  28   31  #include <netinet/in.h> /* For in6_addr_t */
  29   32  #include <sys/tsol/label.h> /* For brange_t */
  30   33  #include <sys/tsol/label_macro.h> /* For brange_t */
  31   34  
  32   35  #ifdef  __cplusplus
  33   36  extern "C" {
↓ open down ↓ 1313 lines elided ↑ open up ↑
1347 1350          int             tcpConnState;
1348 1351                  /* local ip addr for this connection    { tcpConnEntry 2 } */
1349 1352          IpAddress       tcpConnLocalAddress;
1350 1353                  /* local port for this connection       { tcpConnEntry 3 } */
1351 1354          int             tcpConnLocalPort;       /* In host byte order */
1352 1355                  /* remote ip addr for this connection   { tcpConnEntry 4 } */
1353 1356          IpAddress       tcpConnRemAddress;
1354 1357                  /* remote port for this connection      { tcpConnEntry 5 } */
1355 1358          int             tcpConnRemPort;         /* In host byte order */
1356 1359          struct tcpConnEntryInfo_s {
1357      -                        /* seq # of next segment to send */
     1360 +                Counter64       ce_in_data_inorder_bytes;
     1361 +                Counter64       ce_in_data_inorder_segs;
     1362 +                Counter64       ce_in_data_unorder_bytes;
     1363 +                Counter64       ce_in_data_unorder_segs;
     1364 +                Counter64       ce_in_zwnd_probes;
     1365 +
     1366 +                Counter64       ce_out_data_bytes;
     1367 +                Counter64       ce_out_data_segs;
     1368 +                Counter64       ce_out_retrans_bytes;
     1369 +                Counter64       ce_out_retrans_segs;
     1370 +                Counter64       ce_out_zwnd_probes;
     1371 +                Counter64       ce_rtt_sum;
     1372 +
     1373 +                                /* seq # of next segment to send */
1358 1374                  Gauge           ce_snxt;
1359 1375                                  /* seq # of of last segment unacknowledged */
1360 1376                  Gauge           ce_suna;
1361      -                                /* currect send window size */
     1377 +                                /* current send window size */
1362 1378                  Gauge           ce_swnd;
     1379 +                                /* current congestion window size */
     1380 +                Gauge           ce_cwnd;
1363 1381                                  /* seq # of next expected segment */
1364 1382                  Gauge           ce_rnxt;
1365 1383                                  /* seq # of last ack'd segment */
1366 1384                  Gauge           ce_rack;
1367      -                                /* currenct receive window size */
     1385 +                                /* # of unsent bytes in the xmit queue */
     1386 +                Gauge           ce_unsent;
     1387 +                                /* current receive window size */
1368 1388                  Gauge           ce_rwnd;
1369      -                                        /* current rto (retransmit timeout) */
     1389 +                                /* round-trip time smoothed average (us) */
     1390 +                Gauge           ce_rtt_sa;
     1391 +                                /* current rto (retransmit timeout) */
1370 1392                  Gauge           ce_rto;
1371      -                                        /* current max segment size */
     1393 +                                /* round-trip time count */
     1394 +                Gauge           ce_rtt_cnt;
     1395 +                                /* current max segment size */
1372 1396                  Gauge           ce_mss;
1373 1397                                  /* actual internal state */
1374 1398                  int             ce_state;
1375      -        }               tcpConnEntryInfo;
     1399 +        }               tcpConnEntryInfo;
1376 1400  
1377 1401          /* pid of the processes that created this connection */
1378 1402          uint32_t        tcpConnCreationProcess;
1379 1403          /* system uptime when the connection was created */
1380 1404          uint64_t        tcpConnCreationTime;
1381 1405  } mib2_tcpConnEntry_t;
1382 1406  #define MIB_FIRST_NEW_ELM_mib2_tcpConnEntry_t   tcpConnCreationProcess
1383 1407  
1384 1408  #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1385 1409  #pragma pack()
↓ open down ↓ 15 lines elided ↑ open up ↑
1401 1425          /* local port for this connection       { ipv6TcpConnEntry 2 } */
1402 1426          int             tcp6ConnLocalPort;
1403 1427          /* remote ip addr for this connection   { ipv6TcpConnEntry 3 } */
1404 1428          Ip6Address      tcp6ConnRemAddress;
1405 1429          /* remote port for this connection      { ipv6TcpConnEntry 4 } */
1406 1430          int             tcp6ConnRemPort;
1407 1431          /* interface index or zero              { ipv6TcpConnEntry 5 } */
1408 1432          DeviceIndex     tcp6ConnIfIndex;
1409 1433          /* state of tcp6 connection             { ipv6TcpConnEntry 6 } RW */
1410 1434          int             tcp6ConnState;
1411      -        struct tcp6ConnEntryInfo_s {
1412      -                        /* seq # of next segment to send */
1413      -                Gauge           ce_snxt;
1414      -                                /* seq # of of last segment unacknowledged */
1415      -                Gauge           ce_suna;
1416      -                                /* currect send window size */
1417      -                Gauge           ce_swnd;
1418      -                                /* seq # of next expected segment */
1419      -                Gauge           ce_rnxt;
1420      -                                /* seq # of last ack'd segment */
1421      -                Gauge           ce_rack;
1422      -                                /* currenct receive window size */
1423      -                Gauge           ce_rwnd;
1424      -                                        /* current rto (retransmit timeout) */
1425      -                Gauge           ce_rto;
1426      -                                        /* current max segment size */
1427      -                Gauge           ce_mss;
1428      -                                /* actual internal state */
1429      -                int             ce_state;
1430      -        }               tcp6ConnEntryInfo;
     1435 +        struct tcpConnEntryInfo_s tcp6ConnEntryInfo;
1431 1436  
1432 1437          /* pid of the processes that created this connection */
1433 1438          uint32_t        tcp6ConnCreationProcess;
1434 1439          /* system uptime when the connection was created */
1435 1440          uint64_t        tcp6ConnCreationTime;
1436 1441  } mib2_tcp6ConnEntry_t;
1437 1442  #define MIB_FIRST_NEW_ELM_mib2_tcp6ConnEntry_t  tcp6ConnCreationProcess
1438 1443  
1439 1444  #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1440 1445  #pragma pack()
↓ open down ↓ 354 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX