Back to index

glibc  2.9
Defines | Functions | Variables
netdb.h File Reference
#include <resolv/netdb.h>
#include <inet/netgroup.h>

Go to the source code of this file.

Defines

#define __set_h_errno(x)   (h_errno = (x))
#define AI_DEFAULT   (AI_V4MAPPED | AI_ADDRCONFIG)
#define DECLARE_NSS_PROTOTYPES(service)

Functions

 libc_hidden_proto (hstrerror) libc_hidden_proto(innetgr) libc_hidden_proto(rcmd_af) libc_hidden_proto(rexec_af) libc_hidden_proto(rresvport_af) libc_hidden_proto(ruserok_af) libc_hidden_proto(getaddrinfo) libc_hidden_proto(getnameinfo) libc_hidden_proto(freeaddrinfo) libc_hidden_proto(gai_strerror) libc_hidden_proto(__h_errno_location) extern int __gethostent_r(struct hostent *__restrict __result_buf
int __old_gethostent_r (struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop)
int __gethostbyaddr_r (__const void *__restrict __addr, socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop)
int __old_gethostbyaddr_r (__const void *__restrict __addr, socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop)
int __gethostbyaddr2_r (__const void *__restrict __addr, socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop, int32_t *ttlp)
int __gethostbyname_r (__const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop)
int __old_gethostbyname_r (__const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop)
int __gethostbyname2_r (__const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop)
int __old_gethostbyname2_r (__const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop)
int __gethostbyname3_r (__const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop, int32_t *ttlp, char **canonp)
int __getnetent_r (struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop) attribute_hidden
int __old_getnetent_r (struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop)
int __getnetbyaddr_r (uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop)
int __old_getnetbyaddr_r (uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop)
int __getnetbyname_r (__const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop)
int __old_getnetbyname_r (__const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop)
int __getservent_r (struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result) attribute_hidden
int __old_getservent_r (struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result)
int __getservbyname_r (__const char *__restrict __name, __const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result)
int __old_getservbyname_r (__const char *__restrict __name, __const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result)
int __getservbyport_r (int __port, __const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result)
int __old_getservbyport_r (int __port, __const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result)
int __getprotoent_r (struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result) attribute_hidden
int __old_getprotoent_r (struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result)
int __getprotobyname_r (__const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result)
int __old_getprotobyname_r (__const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result)
int __getprotobynumber_r (int __proto, struct protoent *__restrict __res_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result)
int __old_getprotobynumber_r (int __proto, struct protoent *__restrict __res_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result)
int __getnetgrent_r (char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp, char *__restrict __buffer, size_t __buflen)
int ruserpass (const char *host, const char **aname, const char **apass)
 libc_hidden_proto (ruserpass) struct parser_data
int _nss_files_parse_protoent (char *line, struct protoent *result, struct parser_data *data, size_t datalen, int *errnop)
int _nss_files_parse_servent (char *line, struct servent *result, struct parser_data *data, size_t datalen, int *errnop)
int _nss_files_parse_netent (char *line, struct netent *result, struct parser_data *data, size_t datalen, int *errnop)
enum nss_status _nss_netgroup_parseline (char **cursor, struct __netgrent *result, char *buffer, size_t buflen, int *errnop)

Variables

int h_errno
char *__restrict __buf
char *__restrict size_t __buflen
char *__restrict size_t struct
hostent **__restrict 
__result
char *__restrict size_t struct
hostent **__restrict int
*__restrict __h_errnop 
attribute_hidden

Define Documentation

#define __set_h_errno (   x)    (h_errno = (x))

Definition at line 25 of file netdb.h.

#define AI_DEFAULT   (AI_V4MAPPED | AI_ADDRCONFIG)
#define DECLARE_NSS_PROTOTYPES (   service)

Function Documentation

int __gethostbyaddr2_r ( __const void *__restrict  __addr,
socklen_t  __len,
int  __type,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop,
int32_t ttlp 
)

Here is the caller graph for this function:

int __gethostbyaddr_r ( __const void *__restrict  __addr,
socklen_t  __len,
int  __type,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __gethostbyname2_r ( __const char *__restrict  __name,
int  __af,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __gethostbyname3_r ( __const char *__restrict  __name,
int  __af,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop,
int32_t ttlp,
char **  canonp 
)

Here is the caller graph for this function:

int __gethostbyname_r ( __const char *__restrict  __name,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop 
)

Here is the caller graph for this function:

int __getnetbyaddr_r ( uint32_t  __net,
int  __type,
struct netent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct netent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __getnetbyname_r ( __const char *__restrict  __name,
struct netent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct netent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __getnetent_r ( struct netent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct netent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __getnetgrent_r ( char **__restrict  __hostp,
char **__restrict  __userp,
char **__restrict  __domainp,
char *__restrict  __buffer,
size_t  __buflen 
)

Here is the caller graph for this function:

int __getprotobyname_r ( __const char *__restrict  __name,
struct protoent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct protoent **__restrict  __result 
)

Here is the caller graph for this function:

int __getprotobynumber_r ( int  __proto,
struct protoent *__restrict  __res_buf,
char *__restrict  __buf,
size_t  __buflen,
struct protoent **__restrict  __result 
)
int __getprotoent_r ( struct protoent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct protoent **__restrict  __result 
)
int __getservbyname_r ( __const char *__restrict  __name,
__const char *__restrict  __proto,
struct servent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct servent **__restrict  __result 
)

Here is the caller graph for this function:

int __getservbyport_r ( int  __port,
__const char *__restrict  __proto,
struct servent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct servent **__restrict  __result 
)

Here is the caller graph for this function:

int __getservent_r ( struct servent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct servent **__restrict  __result 
)
int __old_gethostbyaddr_r ( __const void *__restrict  __addr,
socklen_t  __len,
int  __type,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __old_gethostbyname2_r ( __const char *__restrict  __name,
int  __af,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __old_gethostbyname_r ( __const char *__restrict  __name,
struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __old_gethostent_r ( struct hostent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct hostent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __old_getnetbyaddr_r ( uint32_t  __net,
int  __type,
struct netent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct netent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __old_getnetbyname_r ( __const char *__restrict  __name,
struct netent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct netent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __old_getnetent_r ( struct netent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct netent **__restrict  __result,
int *__restrict  __h_errnop 
)
int __old_getprotobyname_r ( __const char *__restrict  __name,
struct protoent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct protoent **__restrict  __result 
)
int __old_getprotobynumber_r ( int  __proto,
struct protoent *__restrict  __res_buf,
char *__restrict  __buf,
size_t  __buflen,
struct protoent **__restrict  __result 
)
int __old_getprotoent_r ( struct protoent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct protoent **__restrict  __result 
)
int __old_getservbyname_r ( __const char *__restrict  __name,
__const char *__restrict  __proto,
struct servent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct servent **__restrict  __result 
)
int __old_getservbyport_r ( int  __port,
__const char *__restrict  __proto,
struct servent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct servent **__restrict  __result 
)
int __old_getservent_r ( struct servent *__restrict  __result_buf,
char *__restrict  __buf,
size_t  __buflen,
struct servent **__restrict  __result 
)
int _nss_files_parse_netent ( char *  line,
struct netent result,
struct parser_data data,
size_t  datalen,
int errnop 
)

Here is the caller graph for this function:

int _nss_files_parse_protoent ( char *  line,
struct protoent result,
struct parser_data data,
size_t  datalen,
int errnop 
)

Here is the caller graph for this function:

int _nss_files_parse_servent ( char *  line,
struct servent result,
struct parser_data data,
size_t  datalen,
int errnop 
)

Here is the caller graph for this function:

enum nss_status _nss_netgroup_parseline ( char **  cursor,
struct __netgrent result,
char *  buffer,
size_t  buflen,
int errnop 
)

Definition at line 188 of file files-netgrp.c.

{
  enum nss_status status;
  const char *host, *user, *domain;
  char *cp = *cursor;

  /* Some sanity checks.  */
  if (cp == NULL)
    return NSS_STATUS_NOTFOUND;

  /* First skip leading spaces.  */
  while (isspace (*cp))
    ++cp;

  if (*cp != '(')
    {
      /* We have a list of other netgroups.  */
      char *name = cp;

      while (*cp != '\0' && ! isspace (*cp))
       ++cp;

      if (name != cp)
       {
         /* It is another netgroup name.  */
         int last = *cp == '\0';

         result->type = group_val;
         result->val.group = name;
         *cp = '\0';
         if (! last)
           ++cp;
         *cursor = cp;
         result->first = 0;

         return NSS_STATUS_SUCCESS;
       }

      return result->first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN;
    }

  /* Match host name.  */
  host = ++cp;
  while (*cp != ',')
    if (*cp++ == '\0')
      return result->first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN;

  /* Match user name.  */
  user = ++cp;
  while (*cp != ',')
    if (*cp++ == '\0')
      return result->first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN;

  /* Match domain name.  */
  domain = ++cp;
  while (*cp != ')')
    if (*cp++ == '\0')
      return result->first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN;
  ++cp;


  /* When we got here we have found an entry.  Before we can copy it
     to the private buffer we have to make sure it is big enough.  */
  if (cp - host > buflen)
    {
      *errnop = ERANGE;
      status = NSS_STATUS_UNAVAIL;
    }
  else
    {
      memcpy (buffer, host, cp - host);
      result->type = triple_val;

      buffer[(user - host) - 1] = '\0';   /* Replace ',' with '\0'.  */
      result->val.triple.host = strip_whitespace (buffer);

      buffer[(domain - host) - 1] = '\0'; /* Replace ',' with '\0'.  */
      result->val.triple.user = strip_whitespace (buffer + (user - host));

      buffer[(cp - host) - 1] = '\0'; /* Replace ')' with '\0'.  */
      result->val.triple.domain = strip_whitespace (buffer + (domain - host));

      status = NSS_STATUS_SUCCESS;

      /* Remember where we stopped reading.  */
      *cursor = cp;

      result->first = 0;
    }

  return status;
}

Here is the caller graph for this function:

int ruserpass ( const char *  host,
const char **  aname,
const char **  apass 
)

Here is the caller graph for this function:


Variable Documentation

__const void * __buf

Definition at line 44 of file netdb.h.

Definition at line 44 of file netdb.h.

Definition at line 45 of file netdb.h.

Definition at line 45 of file netdb.h.