diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-20 11:19:09 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-20 11:19:09 +0000 |
commit | bd3cdcf3940d1647bf86a3cce1e770a8be31e091 (patch) | |
tree | 6df8462e45a98111a5098801adc579ae75d02f45 /ext/socket/rubysocket.h | |
parent | 9ffca4659b0cb91c6253eeb1e0c12978e9567d1a (diff) | |
download | ruby-bd3cdcf3940d1647bf86a3cce1e770a8be31e091.tar.gz |
* 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
Diffstat (limited to 'ext/socket/rubysocket.h')
-rw-r--r-- | ext/socket/rubysocket.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h index 6d4a70a95d..0ba473a216 100644 --- a/ext/socket/rubysocket.h +++ b/ext/socket/rubysocket.h @@ -60,6 +60,19 @@ #endif #endif +#ifdef HAVE_IFADDRS_H +#include <ifaddrs.h> +#endif +#ifdef HAVE_SYS_IOCTL_H +#include <sys/ioctl.h> +#endif +#ifdef HAVE_SYS_SOCKIO_H +#include <sys/sockio.h> +#endif +#ifdef HAVE_NET_IF_H +#include <net/if.h> +#endif + #ifndef EWOULDBLOCK #define EWOULDBLOCK EAGAIN #endif @@ -184,6 +197,8 @@ struct addrinfo* sock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints VALUE fd_socket_addrinfo(int fd, struct sockaddr *addr, socklen_t len); VALUE io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len); +VALUE addrinfo_new(struct sockaddr *addr, socklen_t len, int family, int socktype, int protocol, VALUE canonname, VALUE inspectname); + VALUE make_ipaddr(struct sockaddr *addr); VALUE ipaddr(struct sockaddr *sockaddr, int norevlookup); VALUE make_hostent(VALUE host, struct addrinfo *addr, VALUE (*ipaddr)(struct sockaddr *, size_t)); |