Граф коммитов

22 Коммитов

Автор SHA1 Сообщение Дата
akr be25c48638 * ext/socket/socket.c (sock_gethostname): use HOST_NAME_MAX.
* ext/socket/raddrinfo.c (make_ipaddr): local variable renamed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 15:39:16 +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
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 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 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
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 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 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
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 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 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 9cd0874fc2 * ext/socket/raddrinfo.c (make_inspectname): add a res argument to
suppress numeric inspectname.
  (init_addrinfo_getaddrinfo): call make_inspectname here.
  (addrinfo_firstonly_new): follow make_inspectname change.
  (addrinfo_list_new): ditto.
  (addrinfo_initialize): follow init_addrinfo_getaddrinfo change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 06:03:42 +00:00
akr 3f9d4f1fbd rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 05:52:16 +00:00
akr 97cbab78dc * ext/socket: split files for each class.
* ext/socket/rubysocket.h: common header.

* ext/socket/basicsocket.c: new file for BasicSocket.

* ext/socket/ipsocket.c: new file for IPSocket.

* ext/socket/tcpsocket.c: new file for TCPSocket.

* ext/socket/tcpserver.c: new file for TCPServer.

* ext/socket/sockssocket.c: new file for SOCKSSocket.

* ext/socket/udpsocket.c: new file for UDPSocket.

* ext/socket/unixsocket.c: new file for UNIXSocket.

* ext/socket/unixserver.c: new file for UNIXServer.

* ext/socket/socket.c: now for Socket.

* ext/socket/raddrinfo.c: new file for AddrInfo and name resolution.

* ext/socket/constants.c: new file for constants.

* ext/socket/init.c: new file for utilities.

* ext/socket/mkconstants.rb: export *_to_int.

* ext/socket/extconf.rb: add new object files.

* ext/socket/depend: add dependencies for new files.

* ext/.document: add new files.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 04:11:27 +00:00