]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: display not_sent and min_rtt info
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 18 Feb 2016 01:43:59 +0000 (17:43 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 18 Feb 2016 01:44:39 +0000 (17:44 -0800)
Display new info from net-next kernel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/linux/genetlink.h
include/linux/tcp.h
misc/ss.c

index 8a1d5006eea6638a16b84014da3be9b201117d07..e792092609d35d84afca91bbe1f6438b77969019 100644 (file)
@@ -21,6 +21,7 @@ struct genlmsghdr {
 #define GENL_CMD_CAP_DO                0x02
 #define GENL_CMD_CAP_DUMP      0x04
 #define GENL_CMD_CAP_HASPOL    0x08
+#define GENL_UNS_ADMIN_PERM    0x10
 
 /*
  * List of reserved static generic netlink identifiers:
index 1e9b4a627eff3e9c230f87088f803830531177a9..55d656756c252d95a6c592d3491d3978748602b9 100644 (file)
@@ -196,6 +196,9 @@ struct tcp_info {
        __u64   tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
        __u32   tcpi_segs_out;       /* RFC4898 tcpEStatsPerfSegsOut */
        __u32   tcpi_segs_in;        /* RFC4898 tcpEStatsPerfSegsIn */
+
+       __u32   tcpi_notsent_bytes;
+       __u32   tcpi_min_rtt;
 };
 
 /* for TCP_MD5SIG socket option */
index 13fcc8f661e52a91a01bf2d9ec67de6652c7208e..f0f59026397ec0e95be54252848173f3bb190b36 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -778,7 +778,9 @@ struct tcpstat
        unsigned int        sacked;
        unsigned int        fackets;
        unsigned int        reordering;
+       unsigned int        not_sent;
        double              rcv_rtt;
+       double              min_rtt;
        int                 rcv_space;
        bool                has_ts_opt;
        bool                has_sack_opt;
@@ -1737,6 +1739,10 @@ static void tcp_stats_print(struct tcpstat *s)
                printf(" rcv_rtt:%g", s->rcv_rtt);
        if (s->rcv_space)
                printf(" rcv_space:%d", s->rcv_space);
+       if (s->not_sent)
+               printf(" notsent:%u", s->not_sent);
+       if (s->min_rtt)
+               printf(" minrtt:%g", s->min_rtt);
 }
 
 static void tcp_timer_print(struct tcpstat *s)
@@ -1990,6 +1996,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
                s.bytes_received = info->tcpi_bytes_received;
                s.segs_out = info->tcpi_segs_out;
                s.segs_in = info->tcpi_segs_in;
+               s.not_sent = info->tcpi_notsent_bytes;
+               s.min_rtt = (double) info->tcpi_min_rtt / 1000;
                tcp_stats_print(&s);
                free(s.dctcp);
        }