summaryrefslogtreecommitdiff
path: root/ext/socket/mkconstants.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 17:40:41 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 17:40:41 +0000
commitaa0ae0d3b6ab8d6c3143960bd0b3d154bd96d10e (patch)
tree41d1dfee546a4713ea618d0821614848dfe26fa2 /ext/socket/mkconstants.rb
parentff7e0f7f614ed1db3e3464db290192aebac1c096 (diff)
* ext/socket/socket.c (optname_arg): defined.
(bsock_setsockopt): use optname_arg. (bsock_getsockopt): ditto. * ext/socket/mkconstants.rb: generate so_optname_to_int, ip_optname_to_int, ipv6_optname_to_int, tcp_optname_to_int and udp_optname_to_int. more constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/mkconstants.rb')
-rw-r--r--ext/socket/mkconstants.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index a4f7569..318ffde 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -157,6 +157,36 @@ level_to_int(char *str, int len, int *valp)
<%= gen_name_to_int("str", "len", "valp", /\A(SOL_SOCKET\z|IPPROTO_)/) %>
}
+static int
+so_optname_to_int(char *str, int len, int *valp)
+{
+<%= gen_name_to_int("str", "len", "valp", /\ASO_/) %>
+}
+
+static int
+ip_optname_to_int(char *str, int len, int *valp)
+{
+<%= gen_name_to_int("str", "len", "valp", /\AIP_/) %>
+}
+
+static int
+ipv6_optname_to_int(char *str, int len, int *valp)
+{
+<%= gen_name_to_int("str", "len", "valp", /\AIPV6_/) %>
+}
+
+static int
+tcp_optname_to_int(char *str, int len, int *valp)
+{
+<%= gen_name_to_int("str", "len", "valp", /\ATCP_/) %>
+}
+
+static int
+udp_optname_to_int(char *str, int len, int *valp)
+{
+<%= gen_name_to_int("str", "len", "valp", /\AUDP_/) %>
+}
+
static char *
family_to_str(int val)
{
@@ -335,6 +365,13 @@ IP_RECVOPTS
IP_RECVRETOPTS
IP_RECVDSTADDR
IP_RETOPTS
+IP_MINTTL
+IP_DONTFRAG
+IP_SENDSRCADDR
+IP_ONESBCAST
+IP_RECVTTL
+IP_RECVIF
+IP_PORTRANGE
IP_MULTICAST_IF
IP_MULTICAST_TTL
IP_MULTICAST_LOOP
@@ -390,6 +427,21 @@ IPX_TYPE
TCP_NODELAY
TCP_MAXSEG
+TCP_CORK
+TCP_DEFER_ACCEPT
+TCP_INFO
+TCP_KEEPCNT
+TCP_KEEPIDLE
+TCP_KEEPINTVL
+TCP_LINGER2
+TCP_MD5SIG
+TCP_NOOPT
+TCP_NOPUSH
+TCP_QUICKACK
+TCP_SYNCNT
+TCP_WINDOW_CLAMP
+
+UDP_CORK
EAI_ADDRFAMILY
EAI_AGAIN