Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Typedefs | Functions | Variables
getnameinfo.c File Reference
#include "ruby/config.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include <stddef.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 ENI_NOSOCKET   0
 
#define ENI_NOSERVNAME   1
 
#define ENI_NOHOSTNAME   2
 
#define ENI_MEMORY   3
 
#define ENI_SYSTEM   4
 
#define ENI_FAMILY   5
 
#define ENI_SALEN   6
 

Typedefs

typedef int socklen_t
 

Functions

static const char * inet_ntop (int af, const void *addr, char *numaddr, size_t numaddr_len)
 
int getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
 

Variables

static struct afd afdl []
 

Macro Definition Documentation

◆ ANY

#define ANY   0

Definition at line 82 of file getnameinfo.c.

◆ ENI_FAMILY

#define ENI_FAMILY   5

Definition at line 118 of file getnameinfo.c.

Referenced by getnameinfo().

◆ ENI_MEMORY

#define ENI_MEMORY   3

Definition at line 116 of file getnameinfo.c.

Referenced by getnameinfo().

◆ ENI_NOHOSTNAME

#define ENI_NOHOSTNAME   2

Definition at line 115 of file getnameinfo.c.

Referenced by getnameinfo().

◆ ENI_NOSERVNAME

#define ENI_NOSERVNAME   1

Definition at line 114 of file getnameinfo.c.

Referenced by getnameinfo().

◆ ENI_NOSOCKET

#define ENI_NOSOCKET   0

Definition at line 113 of file getnameinfo.c.

Referenced by getnameinfo().

◆ ENI_SALEN

#define ENI_SALEN   6

Definition at line 119 of file getnameinfo.c.

Referenced by getnameinfo().

◆ ENI_SYSTEM

#define ENI_SYSTEM   4

Definition at line 117 of file getnameinfo.c.

Referenced by getnameinfo().

◆ N_INET

#define N_INET   0

◆ NO

#define NO   0

Definition at line 84 of file getnameinfo.c.

◆ SUCCESS

#define SUCCESS   0

Definition at line 81 of file getnameinfo.c.

Referenced by getnameinfo().

◆ YES

#define YES   1

Definition at line 83 of file getnameinfo.c.

Typedef Documentation

◆ socklen_t

typedef int socklen_t

Definition at line 75 of file getnameinfo.c.

Function Documentation

◆ getnameinfo()

int getnameinfo ( const struct sockaddr *  sa,
socklen_t  salen,
char *  host,
socklen_t  hostlen,
char *  serv,
socklen_t  servlen,
int  flags 
)

◆ inet_ntop()

static const char* inet_ntop ( int  af,
const void *  addr,
char *  numaddr,
size_t  numaddr_len 
)
static

Definition at line 123 of file getnameinfo.c.

References snprintf.

Referenced by getnameinfo().

Variable Documentation

◆ afdl

struct afd afdl[]
static
Initial value:
= {
#define N_INET
{PF_INET, sizeof(struct in_addr),
sizeof(struct sockaddr_in),
offsetof(struct sockaddr_in, sin_addr)},
{0, 0, 0, 0},
}
#define PF_INET
Definition: sockport.h:109
#define offsetof(p_type, field)
Definition: addrinfo.h:186
#define sizeof(x)
Definition: zlib.c:58

Referenced by getnameinfo().