akr
8f9d6d1863
* ext/socket/option.c (inspect_peercred): new function to show
...
SO_PEERCRED socket option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 14:23:16 +00:00
akr
411e9997d2
* ext/socket/extconf.rb: check struct cmsgcred.
...
* ext/socket/ancdata.c (anc_inspect_passcred_credentials): add
"(ucred)".
(anc_inspect_socket_creds): show struct cmsgcred too, for FreeBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 12:53:55 +00:00
akr
e960cf417a
* ext/socket/extconf.rb: check struct sockcred.
...
* ext/socket/ancdata.c (anc_inspect_socket_creds): new function to
show SCM_CREDS on NetBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 11:36:18 +00:00
akr
aa28707309
more constants.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 10:24:51 +00:00
akr
a23547cafa
* ext/socket/ancdata.c (anc_inspect_passcred_credentials): new
...
function to show SCM_CREDENTIALS on GNU/Linux.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 09:47:00 +00:00
akr
03149710e8
* ext/socket/raddrinfo.c (init_unix_addrinfo): add socktype argument.
...
(addrinfo_initialize): follow init_unix_addrinfo change.
(addrinfo_s_unix): add optional argument: socktype
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 04:53:17 +00:00
akr
e3cc17a3ac
fix rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 02:10:57 +00:00
nobu
7c93e56560
* lib/mkmf.rb (have_header): needs dependent headers if trying to
...
compile.
* ext/socket/extconf.rb: net/if.h depends on other headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 02:44:07 +00:00
akr
88f04bdd32
* ext/socket: AddrInfo is renamed to Addrinfo. [ruby-dev:37876]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 11:01:43 +00:00
akr
5ce10c1359
* ext/socket/socket.c (sock_s_socketpair): make 3rd argument optional.
...
* ext/socket/unixsocket.c (unix_s_socketpair): follow the above
change.
* ext/socket/rubysocket.h (sock_s_socketpair): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 16:20:05 +00:00
akr
9dfc90dc70
* ext/socket/raddrinfo.c (addrinfo_ipv6_to_ipv4): new method.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 15:10:03 +00:00
akr
12a5cf8287
revert useless change part in the previous commit.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 16:40:42 +00:00
akr
20ac101dae
* ext/socket/extconf.rb: fix struct in_pktinfo and struct in6_pktinfo
...
detection.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 16:29:23 +00:00
akr
9274fbfae9
* ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): skip
...
socket creation error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 15:21:42 +00:00
akr
24eafe8376
* ext/socket/lib/socket.rb (Socket.tcp_server_sockets_port0): new
...
private function for allocating same port both IPv4 and IPv6.
(Socket.tcp_server_sockets): use tcp_server_sockets_port0 for port 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 07:25:57 +00:00
akr
13a468db17
* ext/socket/lib/socket.rb (Socket.tcp_server_sockets): extracted from
...
Socket.tcp_server_loop.
(Socket.accept_loop): ditto.
(Socket.unix_server_socket): extracted from Socket.unix_server_loop.
(Socket.unix_server_loop): use Socket.accept_loop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 23:36:43 +00:00
nobu
b256c5fb8f
* ext/socket/extconf.rb (in_pktinfo, in6_pktinfo),
...
ext/socket/ancdata.c: defined in w32api/ws2tcpip.h on cygwin but
cannot compile for some reason.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 22:58:03 +00:00
akr
e53c88a44f
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 22:31:50 +00:00
akr
9946e700c1
* ext/socket/raddrinfo.c (Init_addrinfo): add AddrInfo#to_s as an
...
alias of AddrInfo#to_sockaddr.
* ext/socket/option.c (Init_sockopt): add Socket::Option#to_s as an
alias of Socket::Option#data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 14:44:28 +00:00
akr
29bd89281b
* ext/socket/ancdata.c (cmsg_type_to_sym): add #ifdef for no IPv6
...
environment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 08:12:10 +00:00
akr
5ad05f37a5
* ext/socket/socket.c (sock_initialize): make 3rd argument, protocol,
...
optional.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 05:55:56 +00:00
usa
57d85f32f5
* ext/socket/constants.c (cmsg_type_arg): INET6 check.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 05:23:23 +00:00
akr
b41a9abb6a
* ext/socket/option.c: use INET6 instead of IPV6.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 05:18:55 +00:00
usa
bf23d53b94
* ext/socket/{options,raddrinfo}.c: use INET6 instead of AF_INET6 for
...
VC++6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 03:48:31 +00:00
akr
61fc0c6cf4
* ext/socket/rubysocket.h (cmsg_type_arg): declared.
...
(Init_ancdata): ditto.
* ext/socket/init.c (Init_socket_init): call Init_ancdata.
* ext/socket/constants.c (cmsg_type_arg): defined.
* ext/socket/depend: add dependency for ancdata.o.
* ext/socket/mkconstants.rb: generate scm_optname_to_int.
more constants.
* ext/socket/extconf.rb: add ancdata.o.
* ext/socket/ancdata.c: new file. new method
BasicSocket#{sendmsg,sendmsg_nonblock,recvmsg,recvmsg_nonblock}
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 02:51:02 +00:00
akr
ef9206bbea
* ext/socket/rubysocket.h (rb_cSockOpt): declared.
...
(sockopt_new): ditto.
(Init_sockopt): ditto.
* ext/socket/init.c (Init_socket_init): call Init_sockopt.
* ext/socket/depend: add dependency for option.o
* ext/socket/mkconstants.rb: generate intern_level, intern_so_optname,
intern_ip_optname, intern_ipv6_optname, intern_tcp_optname,
intern_udp_optname and intern_scm_optname.
* ext/socket/extconf.rb: add option.o.
* ext/socket/basicsocket.c (bsock_setsockopt): accept Socket::Option
object.
(bsock_getsockopt): return Socket::Option object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 01:53:02 +00:00
akr
f1137963e3
* ext/socket/raddrinfo.c (addrinfo_ipv4_private_p): new method.
...
(addrinfo_ipv4_loopback_p): ditto.
(addrinfo_ipv4_multicast_p): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-01 12:28:50 +00:00
akr
849e730f15
* ext/socket/raddrinfo.c (addrinfo_ipv6_unspecified_p): new method.
...
(addrinfo_ipv6_loopback_p): ditto.
(addrinfo_ipv6_multicast_p): ditto.
(addrinfo_ipv6_linklocal_p): ditto.
(addrinfo_ipv6_sitelocal_p): ditto.
(addrinfo_ipv6_v4mapped_p): ditto.
(addrinfo_ipv6_v4compat_p): ditto.
(addrinfo_ipv6_mc_nodelocal_p): ditto.
(addrinfo_ipv6_mc_linklocal_p): ditto.
(addrinfo_ipv6_mc_sitelocal_p): ditto.
(addrinfo_ipv6_mc_orglocal_p): ditto.
(addrinfo_ipv6_mc_global_p): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-31 11:09:51 +00:00
usa
68db4a3464
* ext/socket/spclet.c (socket_s_ip_address_list): support Windows XP
...
or later. (Win2k or earlier is still not supported)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-29 02:25:39 +00:00
akr
2d958b7fb0
* ext/socket/init.c (socks_connect_blocking): moved from
...
sockssocket.c. [ruby-dev:37834]
* sockssocket.c (socks_init): don't omit "int" type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-27 11:07:41 +00:00
akr
efdef4dbe2
* ext/socket/socket.c (socket_s_ip_address_list): renamed from
...
socket_s_list_ip_address. [ruby-dev:37806]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-25 07:36:45 +00:00
nobu
45c4ae9b8b
* ext/socket/socket.c (socket_s_list_ip_address): constified.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-25 03:33:54 +00:00
nobu
044965df97
* ext/socket/extconf.rb ($distcleanfiles): fixed typo.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22 08:02:41 +00:00
nobu
d597a39042
* ext/socket/extconf.rb ($distcleanfiles): removes constdefs.[ch].
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-22 07:57:41 +00:00
akr
bd3cdcf394
* ext/socket/socket.c (socket_s_list_ip_address): new method.
...
(sockaddr_obj): new function.
* ext/socket/rubysocket.h: include ifaddrs.h, sys/ioctl.h,
sys/sockio.h, net/if.h if available.
(addrinfo_new): declared.
* ext/socket/raddrinfo.c (addrinfo_new): exported.
* ext/socket/extconf.rb: check ifaddrs.h, sys/ioctl.h, sys/sockio.h,
net/if.h and getifaddrs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-20 11:19:09 +00:00
akr
9ffca4659b
* ext/socket/rubysocket.h (pseudo_AF_FTIP): moved from mkconstants.rb.
...
* ext/socket/mkconstants.rb: prepend header if -H is not given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-20 11:06:22 +00:00
akr
6d39bc3189
* ext/socket/mkconstants.rb (SOMAXCONN): defined.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 16:16:05 +00:00
akr
b1956f058f
* ext/socket/mkconstants.rb: use erb for generating code.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 13:32:31 +00:00
nobu
2aa6644acd
* ext/socket/rubysocket.h (rb_cUNIXSocket, rb_cUNIXServer),
...
(unixpath, unixaddr): UNIX domain sockets depend on sys/un.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 02:22:57 +00:00
nobu
fb4bea8aaf
* ext/socket/raddrinfo.c (addrinfo_ip_port): use AF_INET6 only when
...
defined, as well as addrinfo_ipv6_p().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 02:00:52 +00:00
usa
f14e2a074a
* ext/socket/depend: workaround for nmake. files in depend without
...
paths should converted by RULE_SUBST, but mkmf.rb cannot recognize
macros currently.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 01:35:57 +00:00
usa
80980a98b1
* ext/socket/raddrinfo.c (addrinfo_mdump, addrinfo_mload): support
...
UNIX socket only on platforms which support it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 00:23:48 +00:00
akr
db881044bc
* ext/socket/raddrinfo.c (addrinfo_inspect_sockaddr): new
...
method AddrInfo#inspect_sockaddr.
(inspect_sockaddr): extracted from addrinfo_inspect.
(addrinfo_inspect): use inspect_sockaddr.
(Init_addrinfo): define the new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 08:03:24 +00:00
akr
d620500dda
* ext/socket/raddrinfo.c (addrinfo_ip_address): new method
...
AddrInfo#ip_address.
(addrinfo_ip_port): new method AddrInfo#ip_port.
(Init_addrinfo): define the methods above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 07:47:35 +00:00
akr
55bf8fa11c
* ext/socket/unixsocket.c: redandant #ifdef removed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 05:30:35 +00:00
akr
ec52a63792
* ext/socket/raddrinfo.c (addrinfo_mdump): don't use symbol.
...
(addrinfo_mload): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 18:35:15 +00:00
akr
86aa5043d8
* ext/socket/raddrinfo.c (addrinfo_mdump): new method.
...
(addrinfo_mload): new method.
(Init_addrinfo): define the method above.
* ext/socket/constants.c (constant_arg): str_to_int's first argument
constified.
* ext/socket/mkconstants.rb (gen_name_to_int_decl): generated
function's first argument constified.
(gen_name_to_int_func_in_guard): ditto.
(ipproto_to_int): generated.
* ext/socket/rubysocket.h (IS_IP_FAMILY): moved from raddrinfo.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 18:14:34 +00:00
akr
e2f8800667
* ext/socket/socket.c (sock_s_getnameinfo): accept AddrInfo object.
...
* ext/socket/raddrinfo.c (rb_check_sockaddr_string_type): defined.
* ext/socket/rubysocket.h (rb_check_sockaddr_string_type): declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 16:39:03 +00:00
akr
d4510f5973
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 15:40:30 +00:00
akr
52152a63aa
* ext/socket/lib/socket.rb: new file.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 13:04:03 +00:00