netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] TCP: Add seq and ack numbers to TCP_INFO
@ 2008-07-09 17:23 Adam Langley
  2008-07-09 17:49 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Langley @ 2008-07-09 17:23 UTC (permalink / raw)
  To: davem; +Cc: netdev

TCP: Add seq and ack numbers to TCP_INFO

No ABI breakage: Userspace specifies the size of the structure that they're
expecting, and the new fields are at the end, so existing code should function
just fine as we'll truncate the new struct tcp_info to fit.

Signed-off-by: Adam Langley <agl@imperialviolet.org>
---

 include/linux/tcp.h |    5 +++++
 net/ipv4/tcp.c      |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 07e79bd..55094ea 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -157,6 +157,11 @@ struct tcp_info
 	__u32	tcpi_rcv_space;
 
 	__u32	tcpi_total_retrans;
+
+	__u32	tcpi_seq; /* seq number of next byte to be written to socket */
+	__u32	tcpi_ack; /* ack number of next byte to be read from socket */
+	__u32	tcpi_tseq; /* seq number of next byte to be transmitted */
+	__u32	tcpi_tack; /* ack number of next byte to be received */
 };
 
 /* for TCP_MD5SIG socket option */
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 56a133c..c56d5c3 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2255,6 +2255,11 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
 	info->tcpi_rcv_space = tp->rcvq_space.space;
 
 	info->tcpi_total_retrans = tp->total_retrans;
+
+	info->tcpi_seq = tp->write_seq;
+	info->tcpi_ack = tp->copied_seq;
+	info->tcpi_tseq = tp->pushed_seq;
+	info->tcpi_tack = tp->rcv_nxt;
 }
 
 EXPORT_SYMBOL_GPL(tcp_get_info);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-09 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-09 17:23 [PATCH] TCP: Add seq and ack numbers to TCP_INFO Adam Langley
2008-07-09 17:49 ` Stephen Hemminger
2008-07-09 18:02   ` Adam Langley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).