Ruby
2.1.10p492(2016-04-01revision54464)
|
#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; } |
Typedefs | |
typedef int | socklen_t |
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 91 of file getaddrinfo.c.
Referenced by getaddrinfo().
Definition at line 199 of file getaddrinfo.c.
Referenced by get_addr(), and getaddrinfo().
#define GET_AI | ( | ai, | |
afd, | |||
addr, | |||
port | |||
) |
Definition at line 181 of file getaddrinfo.c.
Referenced by get_addr(), get_name(), and getaddrinfo().
#define GET_CANONNAME | ( | ai, | |
str | |||
) |
Definition at line 171 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 93 of file getaddrinfo.c.
Referenced by str_isnumber().
#define PTON_MAX 4 |
Definition at line 143 of file getaddrinfo.c.
Referenced by getaddrinfo().
#define SUCCESS 0 |
Definition at line 90 of file getaddrinfo.c.
Referenced by get_addr(), get_name(), and getaddrinfo().
#define YES 1 |
Definition at line 92 of file getaddrinfo.c.
Referenced by getaddrinfo(), and str_isnumber().
Definition at line 84 of file getaddrinfo.c.
|
static |
|
static |
Definition at line 215 of file getaddrinfo.c.
References addrinfo::ai_canonname, addrinfo::ai_next, free, and NULL.
Referenced by get_addr(), get_name(), getaddrinfo(), and rb_freeaddrinfo().
char* gai_strerror | ( | int | ecode | ) |
Definition at line 206 of file getaddrinfo.c.
References EAI_MAX.
Referenced by rsock_raise_socket_error().
|
static |
Definition at line 576 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, NI_MAXHOST, NULL, strlen(), SUCCESS, top, and u_short.
Referenced by getaddrinfo().
|
static |
Definition at line 536 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 271 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 243 of file getaddrinfo.c.
Referenced by getaddrinfo(), and numeric_getaddrinfo().
Definition at line 229 of file getaddrinfo.c.
Referenced by getaddrinfo().
|
static |
Referenced by get_addr(), and getaddrinfo().
Definition at line 153 of file getaddrinfo.c.
|
static |
Definition at line 101 of file getaddrinfo.c.
|
static |
Definition at line 105 of file getaddrinfo.c.
|
static |
Definition at line 100 of file getaddrinfo.c.
|
static |
Definition at line 104 of file getaddrinfo.c.