Ruby
2.0.0p247(2013-06-27revision41674)
|
#include "ruby/config.h"
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
#include "addrinfo.h"
#include "sockport.h"
Go to the source code of this file.
Data Structures | |
struct | sockinet |
struct | afd |
Macros | |
#define | SUCCESS 0 |
#define | ANY 0 |
#define | YES 1 |
#define | NO 0 |
#define | N_INET 0 |
#define | PTON_MAX 4 |
#define | GET_CANONNAME(ai, str) |
#define | GET_AI(ai, afd, addr, port) |
#define | ERR(err) { error = (err); goto bad; } |
Functions | |
static int get_name | __P ((const char *, const struct afd *, struct addrinfo **, char *, struct addrinfo *, int)) |
static int get_addr | __P ((const char *, int, struct addrinfo **, struct addrinfo *, int)) |
static int str_isnumber | __P ((const char *)) |
char * | gai_strerror (int ecode) |
void | freeaddrinfo (struct addrinfo *ai) |
static int | str_isnumber (const char *p) |
static int | inet_pton (int af, const char *hostname, void *pton) |
int | getaddrinfo (const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) |
static int | get_name (const char *addr, const struct afd *afd, struct addrinfo **res, char *numaddr, struct addrinfo *pai, int port0) |
static int | get_addr (const char *hostname, int af, struct addrinfo **res, struct addrinfo *pai, int port0) |
Variables | |
static const char | in_addrany [] = { 0, 0, 0, 0 } |
static const char | in6_addrany [] |
static const char | in_loopback [] = { 127, 0, 0, 1 } |
static const char | in6_loopback [] |
static struct afd | afdl [] |
static const char *const | ai_errlist [] |
#define ANY 0 |
Definition at line 87 of file getaddrinfo.c.
Referenced by getaddrinfo().
Definition at line 195 of file getaddrinfo.c.
Referenced by curses_curs_set(), get_addr(), getaddrinfo(), and window_getbkgd().
#define GET_AI | ( | ai, | |
afd, | |||
addr, | |||
port | |||
) |
Definition at line 177 of file getaddrinfo.c.
Referenced by get_addr(), get_name(), and getaddrinfo().
#define GET_CANONNAME | ( | ai, | |
str | |||
) |
Definition at line 167 of file getaddrinfo.c.
Referenced by get_addr(), and get_name().
#define N_INET 0 |
Referenced by get_addr().
#define NO 0 |
Definition at line 89 of file getaddrinfo.c.
Referenced by str_isnumber().
#define PTON_MAX 4 |
Definition at line 139 of file getaddrinfo.c.
Referenced by getaddrinfo().
#define SUCCESS 0 |
Definition at line 86 of file getaddrinfo.c.
Referenced by get_addr(), get_name(), and getaddrinfo().
#define YES 1 |
Definition at line 88 of file getaddrinfo.c.
Referenced by getaddrinfo(), and str_isnumber().
|
static |
|
static |
Definition at line 211 of file getaddrinfo.c.
References addrinfo::ai_canonname, addrinfo::ai_next, free, and NULL.
Referenced by addrinfo_firstonly_new(), addrinfo_list_new(), get_addr(), get_name(), getaddrinfo(), inetsock_cleanup(), init_addrinfo_getaddrinfo(), ip_s_getaddress(), rsock_freeaddrinfo(), sock_s_getaddrinfo(), sock_s_getnameinfo(), sock_s_pack_sockaddr_in(), udp_bind(), and udp_send().
char* gai_strerror | ( | int | ecode | ) |
Definition at line 202 of file getaddrinfo.c.
References EAI_MAX.
Referenced by rsock_raise_socket_error().
|
static |
Definition at line 572 of file getaddrinfo.c.
References afd::a_af, AF_UNSPEC, afdl, addrinfo::ai_addr, AI_ADDRCONFIG, AI_ALL, addrinfo::ai_next, AI_V4MAPPED, bad, EAI_AGAIN, EAI_FAIL, EAI_NODATA, ERR, free, freeaddrinfo(), freehostent, GET_AI, GET_CANONNAME, i, memcpy(), N_INET, NULL, SUCCESS, top, and u_short.
Referenced by getaddrinfo().
|
static |
Definition at line 532 of file getaddrinfo.c.
References afd::a_addrlen, afd::a_af, free, freeaddrinfo(), freehostent, GET_AI, GET_CANONNAME, NULL, SUCCESS, and u_short.
Referenced by getaddrinfo().
int getaddrinfo | ( | const char * | hostname, |
const char * | servname, | ||
const struct addrinfo * | hints, | ||
struct addrinfo ** | res | ||
) |
Definition at line 267 of file getaddrinfo.c.
References afd::a_addrany, afd::a_af, afd::a_loopback, afdl, addrinfo::ai_addr, addrinfo::ai_addrlen, AI_CANONNAME, addrinfo::ai_canonname, addrinfo::ai_family, addrinfo::ai_flags, AI_MASK, addrinfo::ai_next, AI_NUMERICHOST, AI_NUMERICSERV, AI_PASSIVE, addrinfo::ai_protocol, addrinfo::ai_socktype, ANY, bad, EAI_BADFLAGS, EAI_BADHINTS, EAI_FAIL, EAI_FAMILY, EAI_NONAME, EAI_PROTOCOL, EAI_SERVICE, EAI_SOCKTYPE, ERR, free, freeaddrinfo(), get_addr(), GET_AI, get_name(), getenv(), i, if(), IN_CLASSA_NSHIFT, IN_EXPERIMENTAL, IN_LOOPBACKNET, IN_MULTICAST, inet_pton(), memcpy(), NULL, PF_INET, PF_UNSPEC, proto, PTON_MAX, q, s, str_isnumber(), SUCCESS, top, u_long, u_short, and YES.
Referenced by nogvl_getaddrinfo(), and rb_getaddrinfo().
Definition at line 239 of file getaddrinfo.c.
Referenced by getaddrinfo().
Definition at line 225 of file getaddrinfo.c.
Referenced by getaddrinfo().
|
static |
Referenced by get_addr(), and getaddrinfo().
Definition at line 149 of file getaddrinfo.c.
|
static |
Definition at line 97 of file getaddrinfo.c.
|
static |
Definition at line 101 of file getaddrinfo.c.
|
static |
Definition at line 96 of file getaddrinfo.c.
|
static |
Definition at line 100 of file getaddrinfo.c.