gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

getaddrinfo.c File Reference
#include <config.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include "gettext.h"
#include "sockets.h"
Include dependency graph for getaddrinfo.c:

Go to the source code of this file.

Macros

#define _GL_ARG_NONNULL(params)
 
#define _(String)   gettext (String)
 
#define N_(String)   String
 
#define PF_INET   AF_INET
 
#define PF_UNSPEC   0
 

Functions

static signed char validate_family (int family)
 
int getaddrinfo (const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
 
void freeaddrinfo (struct addrinfo *ai)
 
int getnameinfo (const struct sockaddr *sa, socklen_t salen, char *node, socklen_t nodelen, char *service, socklen_t servicelen, int flags)
 

Macro Definition Documentation

◆ _

#define _ (   String)    gettext (String)

Definition at line 45 of file getaddrinfo.c.

◆ _GL_ARG_NONNULL

#define _GL_ARG_NONNULL (   params)

Definition at line 20 of file getaddrinfo.c.

◆ N_

#define N_ (   String)    String

Definition at line 46 of file getaddrinfo.c.

◆ PF_INET

#define PF_INET   AF_INET

Definition at line 50 of file getaddrinfo.c.

◆ PF_UNSPEC

#define PF_UNSPEC   0

Definition at line 54 of file getaddrinfo.c.

Function Documentation

◆ freeaddrinfo()

void freeaddrinfo ( struct addrinfo *  ai)

Definition at line 394 of file getaddrinfo.c.

Referenced by main().

◆ getaddrinfo()

int getaddrinfo ( const char *  nodename,
const char *  servname,
const struct addrinfo *  hints,
struct addrinfo **  res 
)

Definition at line 189 of file getaddrinfo.c.

References c, NULL, p, PF_INET, res, strdup(), tmp, and validate_family().

Referenced by main().

◆ getnameinfo()

int getnameinfo ( const struct sockaddr *  sa,
socklen_t  salen,
char *  node,
socklen_t  nodelen,
char *  service,
socklen_t  servicelen,
int  flags 
)

Definition at line 418 of file getaddrinfo.c.

References inet_ntop(), NULL, and snprintf().

◆ validate_family()

static signed char validate_family ( int  family)
static

Definition at line 170 of file getaddrinfo.c.

References PF_INET, and PF_UNSPEC.

Referenced by getaddrinfo().