summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-19 11:52:03 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-19 11:52:03 +0000
commit3aacf8850001fa910edbefd48c7550daa1edcfe5 (patch)
treed9c2343b9b2a8aedce7f06f10ff9def6f1fd1a88 /ext/socket/extconf.rb
parent2817c2eec4022c75c04939ad16abd9d9fb8a3f43 (diff)
* ext/socket/option.c (inspect_tcp_info): New function to inspect struct tcp_info.
(sockopt_inspect): Use inspect_tcp_info. * ext/socket/extconf.rb: Check tcp_info related things. * ext/socket/rubysocket.h: Include netinet/tcp_fsm.h if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb56
1 files changed, 56 insertions, 0 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 6c61324..7bc8ffe 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -309,6 +309,7 @@ end
xti.h
netinet/in_systm.h
netinet/tcp.h
+ netinet/tcp_fsm.h
netinet/udp.h
arpa/inet.h
netpacket/packet.h
@@ -370,6 +371,61 @@ have_msg_control = nil
have_msg_control = have_struct_member('struct msghdr', 'msg_control', headers) unless $mswin or $mingw
have_struct_member('struct msghdr', 'msg_accrights', headers)
+have_type("struct tcp_info", headers)
+have_const("TCP_ESTABLISHED", headers)
+have_const("TCP_SYN_SENT", headers)
+have_const("TCP_SYN_RECV", headers)
+have_const("TCP_FIN_WAIT1", headers)
+have_const("TCP_FIN_WAIT2", headers)
+have_const("TCP_TIME_WAIT", headers)
+have_const("TCP_CLOSE", headers)
+have_const("TCP_CLOSE_WAIT", headers)
+have_const("TCP_LAST_ACK", headers)
+have_const("TCP_LISTEN", headers)
+have_const("TCP_CLOSING", headers)
+have_struct_member('struct tcp_info', 'tcpi_state', headers)
+have_struct_member('struct tcp_info', 'tcpi_ca_state', headers)
+have_struct_member('struct tcp_info', 'tcpi_retransmits', headers)
+have_struct_member('struct tcp_info', 'tcpi_probes', headers)
+have_struct_member('struct tcp_info', 'tcpi_backoff', headers)
+have_struct_member('struct tcp_info', 'tcpi_options', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_wscale', headers)
+have_struct_member('struct tcp_info', 'tcpi_rcv_wscale', headers)
+have_struct_member('struct tcp_info', 'tcpi_rto', headers)
+have_struct_member('struct tcp_info', 'tcpi_ato', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_mss', headers)
+have_struct_member('struct tcp_info', 'tcpi_rcv_mss', headers)
+have_struct_member('struct tcp_info', 'tcpi_unacked', headers)
+have_struct_member('struct tcp_info', 'tcpi_sacked', headers)
+have_struct_member('struct tcp_info', 'tcpi_lost', headers)
+have_struct_member('struct tcp_info', 'tcpi_retrans', headers)
+have_struct_member('struct tcp_info', 'tcpi_fackets', headers)
+have_struct_member('struct tcp_info', 'tcpi_last_data_sent', headers)
+have_struct_member('struct tcp_info', 'tcpi_last_ack_sent', headers)
+have_struct_member('struct tcp_info', 'tcpi_last_data_recv', headers)
+have_struct_member('struct tcp_info', 'tcpi_last_ack_recv', headers)
+have_struct_member('struct tcp_info', 'tcpi_pmtu', headers)
+have_struct_member('struct tcp_info', 'tcpi_rcv_ssthresh', headers)
+have_struct_member('struct tcp_info', 'tcpi_rtt', headers)
+have_struct_member('struct tcp_info', 'tcpi_rttvar', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_ssthresh', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_cwnd', headers)
+have_struct_member('struct tcp_info', 'tcpi_advmss', headers)
+have_struct_member('struct tcp_info', 'tcpi_reordering', headers)
+have_struct_member('struct tcp_info', 'tcpi_rcv_rtt', headers)
+have_struct_member('struct tcp_info', 'tcpi_rcv_space', headers)
+have_struct_member('struct tcp_info', 'tcpi_total_retrans', headers)
+
+# FreeBSD extension
+have_struct_member('struct tcp_info', 'tcpi_snd_wnd', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_bwnd', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_nxt', headers)
+have_struct_member('struct tcp_info', 'tcpi_rcv_nxt', headers)
+have_struct_member('struct tcp_info', 'tcpi_toe_tid', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_rexmitpack', headers)
+have_struct_member('struct tcp_info', 'tcpi_rcv_ooopack', headers)
+have_struct_member('struct tcp_info', 'tcpi_snd_zerowin', headers)
+
case RUBY_PLATFORM
when /mswin(32|64)|mingw/
test_func = "WSACleanup"