Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

getaddrinfo.c File Reference

Go to the source code of this file.

Data Structures

struct  sockinet
struct  afd

Functions

int get_name (const char *, struct afd *, struct addrinfo **, char *, struct addrinfo *, int)
int get_addr (const char *, int, struct addrinfo **, struct addrinfo *, int)
int str_isnumber (const char *)
int get_ai (struct addrinfo **to_ai, struct addrinfo const *pai, struct afd *afd, const char *addr, short port)
char * gai_strerror (ecode) int ecode

Variables

int translate = NO
in6_addr faith_prefix = IN6ADDR_ANY_INIT
const char in_addrany [] = { 0, 0, 0, 0 }
const char in6_addrany []
const char in_loopback [] = { 127, 0, 0, 1 }
const char in6_loopback []
afd afdl
char * ai_errlist []
servname
const struct addrinfohints
addrinfo ** res
afd * afd
char * numaddr
addrinfopai
int port0
int af


Function Documentation

int get_name const char *   ,
struct afd  ,
struct addrinfo **   ,
char *   ,
struct addrinfo  ,
int   
[static]
 

int get_addr const char *   ,
int   ,
struct addrinfo **   ,
struct addrinfo  ,
int   
[static]
 

int str_isnumber const char *    [static]
 

int get_ai struct addrinfo **    to_ai,
struct addrinfo const *    pai,
struct afd   afd,
const char *    addr,
short    port
[static]
 

Definition at line 149 of file getaddrinfo.c.

References pai.

00154 {
00155         char *p;
00156         if ((*to_ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) +
00157                                               ((afd)->a_socklen)))
00158             == NULL) 
00159                 return 0;
00160         memcpy(*to_ai, pai, sizeof(struct addrinfo));
00161         (*to_ai)->ai_addr = (struct sockaddr *)((*to_ai) + 1);
00162         memset((*to_ai)->ai_addr, 0, (afd)->a_socklen);
00163         (*to_ai)->ai_addrlen = (afd)->a_socklen;
00164 #if HAVE_SOCKADDR_LEN
00165         (*to_ai)->ai_addr->sa_len= (afd)->a_socklen;
00166 #endif
00167         (*to_ai)->ai_addr->sa_family = (*to_ai)->ai_family = (afd)->a_af;
00168         ((struct sockinet *)(*to_ai)->ai_addr)->si_port = port;
00169         p = (char *)((*to_ai)->ai_addr);
00170         memcpy(p + (afd)->a_off, (addr), (afd)->a_addrlen);
00171         return 1;
00172 }

char* gai_strerror ecode   
 

Referenced by check_name(), lookup_name(), open_socket_in(), open_socket_out(), and try_bind_local().


Variable Documentation

int translate = NO [static]
 

Definition at line 54 of file getaddrinfo.c.

struct in6_addr faith_prefix = IN6ADDR_ANY_INIT [static]
 

Definition at line 55 of file getaddrinfo.c.

const char in_addrany[] = { 0, 0, 0, 0 } [static]
 

Definition at line 66 of file getaddrinfo.c.

const char in6_addrany[] [static]
 

Initial value:

 {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 67 of file getaddrinfo.c.

const char in_loopback[] = { 127, 0, 0, 1 } [static]
 

Definition at line 70 of file getaddrinfo.c.

const char in6_loopback[] [static]
 

Initial value:

 {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
}

Definition at line 71 of file getaddrinfo.c.

struct afd afdl [static]
 

char* ai_errlist[] [static]
 

Initial value:

 {
        "success.",
        "address family for hostname not supported.",   
        "temporary failure in name resolution.",        
        "invalid value for ai_flags.",                  
        "non-recoverable failure in name resolution.",  
        "ai_family not supported.",                     
        "memory allocation failure.",                   
        "no address associated with hostname.",         
        "hostname nor servname provided, or not known.",
        "servname not supported for ai_socktype.",      
        "ai_socktype not supported.",                   
        "system error returned in errno.",              
        "invalid value for hints.",                     
        "resolved protocol is unknown.",                
        "unknown error.",                               
}

Definition at line 120 of file getaddrinfo.c.

* servname
 

Definition at line 215 of file getaddrinfo.c.

const struct addrinfo* hints
 

Definition at line 216 of file getaddrinfo.c.

struct addrinfo ** res
 

Definition at line 519 of file getaddrinfo.c.

struct afd* afd
 

Definition at line 469 of file getaddrinfo.c.

char* numaddr
 

Definition at line 471 of file getaddrinfo.c.

struct addrinfo * pai
 

Definition at line 520 of file getaddrinfo.c.

Referenced by get_ai().

int port0
 

Definition at line 521 of file getaddrinfo.c.

int af
 

Definition at line 518 of file getaddrinfo.c.

Referenced by inet_ntop(), and inet_pton().


Generated on Tue Apr 16 12:37:38 2002 for rsync by doxygen1.2.15