about summary refs log tree commit homepage
path: root/ext/raindrops/linux_tcp_info.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-10 10:51:38 +0000
committerEric Wong <normalperson@yhbt.net>2011-03-10 11:04:53 +0000
commit61962b27a51031965cef70451d369b115868fb11 (patch)
tree6f65d228cf5a80ad31430bf03951f5ed198bdf10 /ext/raindrops/linux_tcp_info.c
parent8392f8186cd21f9190474bd6b5ac6ec58c7af96a (diff)
downloadraindrops-61962b27a51031965cef70451d369b115868fb11.tar.gz
Of course, RDoc doesn't know quantity vs quality :)
Diffstat (limited to 'ext/raindrops/linux_tcp_info.c')
-rw-r--r--ext/raindrops/linux_tcp_info.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/ext/raindrops/linux_tcp_info.c b/ext/raindrops/linux_tcp_info.c
index 0c64ded..4aa1c0e 100644
--- a/ext/raindrops/linux_tcp_info.c
+++ b/ext/raindrops/linux_tcp_info.c
@@ -53,6 +53,14 @@ static VALUE alloc(VALUE klass)
         return Data_Wrap_Struct(klass, NULL, -1, info);
 }
 
+/*
+ * call-seq:
+ *
+ *        Raindrops::TCP_Info.new(tcp_socket)        -> TCP_Info object
+ *
+ * Reads a TCP_Info object from any given +tcp_socket+.  See the tcp(7)
+ * manpage and /usr/include/linux/tcp.h for more details.
+ */
 static VALUE init(VALUE self, VALUE io)
 {
         int fd = my_fileno(io);
@@ -71,6 +79,49 @@ void Init_raindrops_linux_tcp_info(void)
         VALUE cRaindrops = rb_const_get(rb_cObject, rb_intern("Raindrops"));
         VALUE cTCP_Info;
 
+        /*
+         * Document-class: Raindrops::TCP_Info
+         *
+         * This is used to wrap "struct tcp_info" as described in tcp(7)
+         * and /usr/include/linux/tcp.h.  The following readers methods
+         * are defined corresponding to the "tcpi_" fields in the
+         * tcp_info struct.
+         *
+         * - state
+         * - ca_state
+         * - retransmits
+         * - probes
+         * - backoff
+         * - options
+         * - snd_wscale
+         * - rcv_wscale
+         * - rto
+         * - ato
+         * - snd_mss
+         * - rcv_mss
+         * - unacked
+         * - sacked
+         * - lost
+         * - retrans
+         * - fackets
+         * - last_data_sent
+         * - last_ack_sent
+         * - last_data_recv
+         * - last_ack_recv
+         * - pmtu
+         * - rcv_ssthresh
+         * - rtt
+         * - rttvar
+         * - snd_ssthresh
+         * - snd_cwnd
+         * - advmss
+         * - reordering
+         * - rcv_rtt
+         * - rcv_space
+         * - total_retrans
+         *
+         * http://kernel.org/doc/man-pages/online/pages/man7/tcp.7.html
+         */
         cTCP_Info = rb_define_class_under(cRaindrops, "TCP_Info", rb_cObject);
         rb_define_alloc_func(cTCP_Info, alloc);
         rb_define_private_method(cTCP_Info, "initialize", init, 1);