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

17 Коммитов

Автор SHA1 Сообщение Дата
akr 2dd3fa9f3e * ext/socket/mkconstants.rb: rename level_to_int to iplevel_to_int.
rename intern_level to intern_iplevel.

* ext/socket/constants.c: follow the renaming.

* ext/socket/option.c: ditto.

* ext/socket/ancdata.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 14:05:37 +00:00
akr f5da7031b9 * ext/socket/rubysocket.h (level_arg): add family argument.
(optname_arg): ditto.
  (cmsg_type_arg): ditto.
  (rb_sock_getfamily): declared.

* ext/socket/constants.c (level_arg): add family argument.
  (optname_arg): ditto.
  (cmsg_type_arg): ditto.

* ext/socket/init.c (rb_sock_getfamily): defined.

* ext/socket/option.c (sockopt_initialize): give family for level_arg
  and optname_arg.
  (sockopt_s_int): ditto.

* ext/socket/basicsocket.c (bsock_setsockopt): ditto.
  (bsock_getsockopt): ditto.

* ext/socket/ancdata.c (ancillary_initialize): ditto.
  (ancillary_s_int): ditto.
  (ancillary_cmsg_is_p): ditto.
  (bsock_sendmsg_internal): ditto.
  (bsock_recvmsg_internal): use rb_sock_getfamily.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 13:56:43 +00:00
akr 2092fbcc3a rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 12:52:11 +00:00
akr 7ad3567934 * ext/socket/option.c (inspect_int): return 1/0 on success/failure.
(inspect_uint): ditto.
  (inspect_linger): ditto.
  (inspect_socktype): ditto.
  (inspect_timeval): ditto.
  (inspect_peercred): ditto.
  (inspect_local_peercred): ditto.
  (sockopt_inspect): refactored.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 11:04:51 +00:00
akr 48de4753d1 * ext/socket/option.c (sockopt_initialize): argument conversion
reordered.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 10:52:55 +00:00
akr 70f7660196 * ext/socket/option.c (inspect_local_peercred): check version.
(sockopt_inspect): suppress warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 00:06:41 +00:00
akr 64f12a46d5 * ext/socket/option.c (inspect_peercred): struct ucred contains
effective uid/gid.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 17:04:40 +00:00
akr 2992642245 LOCAL_PEERCRED is also available on MacOS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:49:35 +00:00
akr d0454a211e * ext/socket/option.c (sockopt_inspect): add ifdef guard for
LOCAL_PEERCRED.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:45:15 +00:00
akr f11d2b55f7 * ext/socket/option.c (inspect_local_peercred): cr_uid is a effective
uid, not a real uid.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:42:17 +00:00
akr 9e45748143 * ext/socket/extconf.rb: check sys/param.h and sys/ucred.h.
* ext/socket/rubysocket.h: include sys/param.h and sys/ucred.h.

* ext/socket/option.c (inspect_local_peercred): new function to show
  LOCAL_PEERCRED socket option on FreeBSD.
  (sockopt_inspect): show as LOCAL_* socket option if AF_UNIX and level
  is 0.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:37:55 +00:00
akr c02ce88762 * ext/socket/rubysocket.h (sockopt_new): add family argument.
* ext/socket/option.c (sockopt_initialize): add vfamily argument.
  (sockopt_new): add family argument and record it in the object.
  (sockopt_family): new method.
  (sockopt_s_int): add vfamily argument.
  (sockopt_inspect): show family.

* ext/socket/basicsocket.c (bsock_getsockopt): check address family
  using getsockname.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:12:27 +00:00
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 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 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 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