Ruby
2.5.0dev(2017-10-22revision60238)
|
#include "rubysocket.h"
Go to the source code of this file.
Data Structures | |
struct | getaddrinfo_arg |
struct | getnameinfo_arg |
struct | hostent_arg |
struct | rb_addrinfo_t |
Macros | |
#define | str_equal(ptr, len, name) |
#define | SafeStringValueCStr(v) |
#define | addrinfo_free RUBY_TYPED_DEFAULT_FREE |
#define | IS_ADDRINFO(obj) rb_typeddata_is_kind_of((obj), &addrinfo_type) |
Functions | |
int | rb_getaddrinfo (const char *node, const char *service, const struct addrinfo *hints, struct rb_addrinfo **res) |
void | rb_freeaddrinfo (struct rb_addrinfo *ai) |
int | rb_getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) |
VALUE | rsock_make_ipaddr (struct sockaddr *addr, socklen_t addrlen) |
struct rb_addrinfo * | rsock_getaddrinfo (VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack) |
int | rsock_fd_family (int fd) |
struct rb_addrinfo * | rsock_addrinfo (VALUE host, VALUE port, int family, int socktype, int flags) |
VALUE | rsock_ipaddr (struct sockaddr *sockaddr, socklen_t sockaddrlen, int norevlookup) |
VALUE | rsock_freeaddrinfo (VALUE arg) |
VALUE | rsock_make_hostent (VALUE host, struct rb_addrinfo *addr, VALUE(*ipaddr)(struct sockaddr *, socklen_t)) |
VALUE | rsock_addrinfo_new (struct sockaddr *addr, socklen_t len, int family, int socktype, int protocol, VALUE canonname, VALUE inspectname) |
VALUE | rsock_inspect_sockaddr (struct sockaddr *sockaddr_arg, socklen_t socklen, VALUE ret) |
VALUE | rsock_addrinfo_inspect_sockaddr (VALUE self) |
VALUE | rsock_sockaddr_string_value (volatile VALUE *v) |
VALUE | rsock_sockaddr_string_value_with_addrinfo (volatile VALUE *v, VALUE *rai_ret) |
char * | rsock_sockaddr_string_value_ptr (volatile VALUE *v) |
VALUE | rb_check_sockaddr_string_type (VALUE val) |
VALUE | rsock_fd_socket_addrinfo (int fd, struct sockaddr *addr, socklen_t len) |
VALUE | rsock_io_socket_addrinfo (VALUE io, struct sockaddr *addr, socklen_t len) |
void | rsock_init_addrinfo (void) |
#define addrinfo_free RUBY_TYPED_DEFAULT_FREE |
Definition at line 733 of file raddrinfo.c.
#define IS_ADDRINFO | ( | obj | ) | rb_typeddata_is_kind_of((obj), &addrinfo_type) |
Definition at line 752 of file raddrinfo.c.
Referenced by rb_check_sockaddr_string_type(), rsock_sockaddr_string_value(), and rsock_sockaddr_string_value_with_addrinfo().
#define SafeStringValueCStr | ( | v | ) |
Definition at line 432 of file raddrinfo.c.
Definition at line 429 of file raddrinfo.c.
Definition at line 2507 of file raddrinfo.c.
References IS_ADDRINFO.
void rb_freeaddrinfo | ( | struct rb_addrinfo * | ai | ) |
Definition at line 322 of file raddrinfo.c.
References rb_addrinfo::ai, addrinfo::ai_addr, addrinfo::ai_next, rb_addrinfo::allocated_by_malloc, freeaddrinfo(), and xfree().
Referenced by rsock_freeaddrinfo().
int rb_getaddrinfo | ( | const char * | node, |
const char * | service, | ||
const struct addrinfo * | hints, | ||
struct rb_addrinfo ** | res | ||
) |
Definition at line 288 of file raddrinfo.c.
int rb_getnameinfo | ( | const struct sockaddr * | sa, |
socklen_t | salen, | ||
char * | host, | ||
size_t | hostlen, | ||
char * | serv, | ||
size_t | servlen, | ||
int | flags | ||
) |
Definition at line 363 of file raddrinfo.c.
References getnameinfo_arg::flags, getnameinfo(), getnameinfo_arg::host, getnameinfo_arg::hostlen, rb_thread_call_without_gvl(), getnameinfo_arg::sa, getnameinfo_arg::salen, getnameinfo_arg::serv, and getnameinfo_arg::servlen.
Referenced by rsock_ipaddr().
struct rb_addrinfo* rsock_addrinfo | ( | VALUE | host, |
VALUE | port, | ||
int | family, | ||
int | socktype, | ||
int | flags | ||
) |
Definition at line 547 of file raddrinfo.c.
References addrinfo::ai_family, addrinfo::ai_flags, addrinfo::ai_socktype, MEMZERO, and rsock_getaddrinfo().
Definition at line 1517 of file raddrinfo.c.
Referenced by rsock_syserr_fail_raddrinfo().
VALUE rsock_addrinfo_new | ( | struct sockaddr * | addr, |
socklen_t | len, | ||
int | family, | ||
int | socktype, | ||
int | protocol, | ||
VALUE | canonname, | ||
VALUE | inspectname | ||
) |
Definition at line 798 of file raddrinfo.c.
Referenced by rsock_syserr_fail_sockaddr().
int rsock_fd_family | ( | int | fd | ) |
Definition at line 534 of file raddrinfo.c.
Definition at line 2515 of file raddrinfo.c.
Referenced by rsock_io_socket_addrinfo().
Definition at line 696 of file raddrinfo.c.
References Qnil, and rb_freeaddrinfo().
struct rb_addrinfo* rsock_getaddrinfo | ( | VALUE | host, |
VALUE | port, | ||
struct addrinfo * | hints, | ||
int | socktype_hack | ||
) |
Definition at line 506 of file raddrinfo.c.
References NI_MAXHOST, NI_MAXSERV, and NULL.
Referenced by rsock_addrinfo().
void rsock_init_addrinfo | ( | void | ) |
Definition at line 2560 of file raddrinfo.c.
References rb_cAddrinfo, rb_cData, rb_define_alloc_func(), and rb_define_class().
Referenced by rsock_init_socket_init().
Definition at line 1141 of file raddrinfo.c.
References union_sockaddr::addr, AF_UNSPEC, getnameinfo(), IFNAMSIZ, ISPRINT, ISSPACE, len, NI_NUMERICHOST, NI_NUMERICSERV, NULL, offsetof, rb_id2name(), rb_str_cat(), rb_str_cat2(), rb_str_catf(), rsock_intern_family(), and rsock_raise_socket_error().
Definition at line 2534 of file raddrinfo.c.
References rb_io_t::fd, FIX2INT, GetOpenFile, NUM2INT, rb_eTypeError, rb_raise(), rsock_fd_socket_addrinfo(), T_BIGNUM, T_FILE, T_FIXNUM, TYPE, and UNREACHABLE.
Definition at line 559 of file raddrinfo.c.
References id, INT2FIX, len, NI_NUMERICHOST, NI_NUMERICSERV, NULL, offsetof, Qnil, rb_ary_new3, rb_assoc_new(), rb_eArgError, rb_getnameinfo(), rb_id2str, rb_raise(), rb_str_dup(), rb_str_new(), rb_str_new2, rsock_intern_family(), rsock_raise_socket_error(), RSTRING_LEN, RSTRING_PTR, RSTRING_SOCKLEN, and SOCKLEN_MAX.
VALUE rsock_make_hostent | ( | VALUE | host, |
struct rb_addrinfo * | addr, | ||
VALUE(*)(struct sockaddr *, socklen_t) | ipaddr | ||
) |
Definition at line 704 of file raddrinfo.c.
References hostent_arg::addr, hostent_arg::host, hostent_arg::ipaddr, and rb_ensure().
Definition at line 396 of file raddrinfo.c.
Definition at line 2476 of file raddrinfo.c.
References IS_ADDRINFO, and val.
Referenced by rsock_sockaddr_string_value_ptr().
char* rsock_sockaddr_string_value_ptr | ( | volatile VALUE * | v | ) |
Definition at line 2500 of file raddrinfo.c.
References rsock_sockaddr_string_value(), and RSTRING_PTR.
Definition at line 2487 of file raddrinfo.c.
References IS_ADDRINFO, Qnil, and val.