Back to index

glibc  2.9
Classes | Defines | Typedefs | Enumerations | Functions
resolv.h File Reference
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/param.h>
#include <sys/cdefs.h>
#include <stdio.h>
#include <arpa/nameser.h>

Go to the source code of this file.

Classes

struct  __res_state
struct  res_sym
struct  __res_state.sort_list
union  __res_state._u
struct  __res_state._u._ext

Defines

#define _RESOLV_H_
#define __res_state_defined
#define MAXNS   3 /* max # name servers we'll track */
#define MAXDFLSRCH   3 /* # default domain levels to try */
#define MAXDNSRCH   6 /* max # domains in search path */
#define LOCALDOMAINPARTS   2 /* min levels in name that is "local" */
#define RES_TIMEOUT   5 /* min. seconds between retries */
#define MAXRESOLVSORT   10 /* number of net to sort on */
#define RES_MAXNDOTS   15 /* should reflect bit field size */
#define RES_MAXRETRANS   30 /* only for resolv.conf/RES_OPTIONS */
#define RES_MAXRETRY   5 /* only for resolv.conf/RES_OPTIONS */
#define RES_DFLRETRY   2 /* Default #/tries. */
#define RES_MAXTIME   65535 /* Infinity, in milliseconds. */
#define nsaddr   nsaddr_list[0] /* for backward compatibility */
#define __RES   19991006
#define _PATH_RESCONF   "/etc/resolv.conf"
#define RES_F_VC   0x00000001 /* socket is TCP */
#define RES_F_CONN   0x00000002 /* socket is connected */
#define RES_F_EDNS0ERR   0x00000004 /* EDNS0 caused errors */
#define RES_EXHAUSTIVE   0x00000001 /* always do all queries */
#define RES_INIT   0x00000001 /* address initialized */
#define RES_DEBUG   0x00000002 /* print debug messages */
#define RES_AAONLY   0x00000004 /* authoritative answers only (!IMPL)*/
#define RES_USEVC   0x00000008 /* use virtual circuit */
#define RES_PRIMARY   0x00000010 /* query primary server only (!IMPL) */
#define RES_IGNTC   0x00000020 /* ignore trucation errors */
#define RES_RECURSE   0x00000040 /* recursion desired */
#define RES_DEFNAMES   0x00000080 /* use default domain name */
#define RES_STAYOPEN   0x00000100 /* Keep TCP socket open */
#define RES_DNSRCH   0x00000200 /* search up local domain tree */
#define RES_INSECURE1   0x00000400 /* type 1 security disabled */
#define RES_INSECURE2   0x00000800 /* type 2 security disabled */
#define RES_NOALIASES   0x00001000 /* shuts off HOSTALIASES feature */
#define RES_USE_INET6   0x00002000 /* use/map IPv6 in gethostbyname() */
#define RES_ROTATE   0x00004000 /* rotate ns list after each query */
#define RES_NOCHECKNAME   0x00008000 /* do not check names for sanity. */
#define RES_KEEPTSIG   0x00010000 /* do not strip TSIG records */
#define RES_BLAST   0x00020000 /* blast all recursive servers */
#define RES_USEBSTRING
#define RES_NOIP6DOTINT
#define RES_USE_EDNS0   0x00100000 /* Use EDNS0. */
#define RES_DEFAULT   (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
#define RES_PRF_STATS   0x00000001
#define RES_PRF_UPDATE   0x00000002
#define RES_PRF_CLASS   0x00000004
#define RES_PRF_CMD   0x00000008
#define RES_PRF_QUES   0x00000010
#define RES_PRF_ANS   0x00000020
#define RES_PRF_AUTH   0x00000040
#define RES_PRF_ADD   0x00000080
#define RES_PRF_HEAD1   0x00000100
#define RES_PRF_HEAD2   0x00000200
#define RES_PRF_TTLID   0x00000400
#define RES_PRF_HEADX   0x00000800
#define RES_PRF_QUERY   0x00001000
#define RES_PRF_REPLY   0x00002000
#define RES_PRF_INIT   0x00004000
#define _res   (*__res_state())
#define fp_nquery   __fp_nquery
#define fp_query   __fp_query
#define hostalias   __hostalias
#define p_query   __p_query
#define res_close   __res_close
#define res_init   __res_init
#define res_isourserver   __res_isourserver
#define res_mkquery   __res_mkquery
#define res_query   __res_query
#define res_querydomain   __res_querydomain
#define res_search   __res_search
#define res_send   __res_send
#define b64_ntop   __b64_ntop
#define b64_pton   __b64_pton
#define dn_comp   __dn_comp
#define dn_count_labels   __dn_count_labels
#define dn_expand   __dn_expand
#define dn_skipname   __dn_skipname
#define fp_resstat   __fp_resstat
#define loc_aton   __loc_aton
#define loc_ntoa   __loc_ntoa
#define p_cdname   __p_cdname
#define p_cdnname   __p_cdnname
#define p_class   __p_class
#define p_fqname   __p_fqname
#define p_fqnname   __p_fqnname
#define p_option   __p_option
#define p_secstodate   __p_secstodate
#define p_section   __p_section
#define p_time   __p_time
#define p_type   __p_type
#define p_rcode   __p_rcode
#define putlong   __putlong
#define putshort   __putshort
#define res_dnok   __res_dnok
#define res_hnok   __res_hnok
#define res_hostalias   __res_hostalias
#define res_mailok   __res_mailok
#define res_nameinquery   __res_nameinquery
#define res_nclose   __res_nclose
#define res_ninit   __res_ninit
#define res_nmkquery   __res_nmkquery
#define res_npquery   __res_npquery
#define res_nquery   __res_nquery
#define res_nquerydomain   __res_nquerydomain
#define res_nsearch   __res_nsearch
#define res_nsend   __res_nsend
#define res_nisourserver   __res_nisourserver
#define res_ownok   __res_ownok
#define res_queriesmatch   __res_queriesmatch
#define res_randomid   __res_randomid
#define sym_ntop   __sym_ntop
#define sym_ntos   __sym_ntos
#define sym_ston   __sym_ston

Typedefs

typedef res_sendhookact(* res_send_qhook )(struct sockaddr_in *const *ns, const u_char **query, int *querylen, u_char *ans, int anssiz, int *resplen)
typedef res_sendhookact(* res_send_rhook )(const struct sockaddr_in *ns, const u_char *query, int querylen, u_char *ans, int anssiz, int *resplen)
typedef struct __res_stateres_state

Enumerations

enum  res_sendhookact {
  res_goahead, res_nextns, res_modified, res_done,
  res_error
}

Functions

__BEGIN_DECLS struct __res_state__res_state (void) __attribute__((__const__))
__BEGIN_DECLS void fp_nquery (const u_char *, int, FILE *) __THROW
void fp_query (const u_char *, FILE *) __THROW
const char * hostalias (const char *) __THROW
void p_query (const u_char *) __THROW
void res_close (void) __THROW
int res_init (void) __THROW
int res_isourserver (const struct sockaddr_in *) __THROW
int res_mkquery (int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int) __THROW
int res_query (const char *, int, int, u_char *, int) __THROW
int res_querydomain (const char *, const char *, int, int, u_char *, int) __THROW
int res_search (const char *, int, int, u_char *, int) __THROW
int res_send (const u_char *, int, u_char *, int) __THROW
__BEGIN_DECLS int res_hnok (const char *) __THROW
int res_ownok (const char *) __THROW
int res_mailok (const char *) __THROW
int res_dnok (const char *) __THROW
int sym_ston (const struct res_sym *, const char *, int *) __THROW
const char * sym_ntos (const struct res_sym *, int, int *) __THROW
const char * sym_ntop (const struct res_sym *, int, int *) __THROW
int b64_ntop (u_char const *, size_t, char *, size_t) __THROW
int b64_pton (char const *, u_char *, size_t) __THROW
int loc_aton (const char *ascii, u_char *binary) __THROW
const char * loc_ntoa (const u_char *binary, char *ascii) __THROW
int dn_skipname (const u_char *, const u_char *) __THROW
void putlong (u_int32_t, u_char *) __THROW
void putshort (u_int16_t, u_char *) __THROW
const char * p_class (int) __THROW
const char * p_time (u_int32_t) __THROW
const char * p_type (int) __THROW
const char * p_rcode (int) __THROW
const u_charp_cdnname (const u_char *, const u_char *, int, FILE *) __THROW
const u_charp_cdname (const u_char *, const u_char *, FILE *) __THROW
const u_charp_fqnname (const u_char *cp, const u_char *msg, int, char *, int) __THROW
const u_charp_fqname (const u_char *, const u_char *, FILE *) __THROW
const char * p_option (u_long option) __THROW
char * p_secstodate (u_long) __THROW
int dn_count_labels (const char *) __THROW
int dn_comp (const char *, u_char *, int, u_char **, u_char **) __THROW
int dn_expand (const u_char *, const u_char *, const u_char *, char *, int) __THROW
u_int res_randomid (void) __THROW
int res_nameinquery (const char *, int, int, const u_char *, const u_char *) __THROW
int res_queriesmatch (const u_char *, const u_char *, const u_char *, const u_char *) __THROW
const char * p_section (int section, int opcode) __THROW
int res_ninit (res_state) __THROW
int res_nisourserver (const res_state, const struct sockaddr_in *) __THROW
void fp_resstat (const res_state, FILE *) __THROW
void res_npquery (const res_state, const u_char *, int, FILE *) __THROW
const char * res_hostalias (const res_state, const char *, char *, size_t) __THROW
int res_nquery (res_state, const char *, int, int, u_char *, int) __THROW
int res_nsearch (res_state, const char *, int, int, u_char *, int) __THROW
int res_nquerydomain (res_state, const char *, const char *, int, int, u_char *, int) __THROW
int res_nmkquery (res_state, int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int) __THROW
int res_nsend (res_state, const u_char *, int, u_char *, int) __THROW
void res_nclose (res_state) __THROW

Class Documentation

struct __res_state

Definition at line 104 of file resolv.h.

Collaboration diagram for __res_state:
Class Members
u_int _flags
union __res_state _u
int _vcsock
char defdname
char * dnsrch
u_short id
unsigned ipv6_unavail:1
unsigned ndots:4
int nscount
unsigned nsort:4
u_long options
u_long pfcode
res_send_qhook qhook
int res_h_errno
int retrans
int retry
res_send_rhook rhook
struct __res_state sort_list
unsigned unused:23
struct res_sym

Definition at line 176 of file resolv.h.

Class Members
char * humanname
char * name
int number
struct __res_state.sort_list

Definition at line 121 of file resolv.h.

Class Members
u_int32_t mask
union __res_state._u

Definition at line 132 of file resolv.h.

Class Members
_u _ext
char pad
struct __res_state._u._ext

Definition at line 134 of file resolv.h.

Class Members
unsigned int _initstamp
struct sockaddr_in6 * nsaddrs
u_int16_t nscount
u_int16_t nscount6
u_int16_t nsinit
u_int16_t nsmap
int nssocks

Define Documentation

#define __RES   19991006

Definition at line 164 of file resolv.h.

Definition at line 69 of file resolv.h.

#define _PATH_RESCONF   "/etc/resolv.conf"

Definition at line 173 of file resolv.h.

#define _res   (*__res_state())

Definition at line 243 of file resolv.h.

#define _RESOLV_H_

Definition at line 60 of file resolv.h.

#define b64_ntop   __b64_ntop

Definition at line 277 of file resolv.h.

#define b64_pton   __b64_pton

Definition at line 278 of file resolv.h.

#define dn_comp   __dn_comp

Definition at line 279 of file resolv.h.

#define dn_count_labels   __dn_count_labels

Definition at line 280 of file resolv.h.

#define dn_expand   __dn_expand

Definition at line 281 of file resolv.h.

#define dn_skipname   __dn_skipname

Definition at line 282 of file resolv.h.

#define fp_nquery   __fp_nquery

Definition at line 246 of file resolv.h.

#define fp_query   __fp_query

Definition at line 247 of file resolv.h.

#define fp_resstat   __fp_resstat

Definition at line 283 of file resolv.h.

#define hostalias   __hostalias

Definition at line 248 of file resolv.h.

#define loc_aton   __loc_aton

Definition at line 284 of file resolv.h.

#define loc_ntoa   __loc_ntoa

Definition at line 285 of file resolv.h.

#define LOCALDOMAINPARTS   2 /* min levels in name that is "local" */

Definition at line 94 of file resolv.h.

#define MAXDFLSRCH   3 /* # default domain levels to try */

Definition at line 92 of file resolv.h.

#define MAXDNSRCH   6 /* max # domains in search path */

Definition at line 93 of file resolv.h.

#define MAXNS   3 /* max # name servers we'll track */

Definition at line 91 of file resolv.h.

#define MAXRESOLVSORT   10 /* number of net to sort on */

Definition at line 97 of file resolv.h.

#define nsaddr   nsaddr_list[0] /* for backward compatibility */

Definition at line 111 of file resolv.h.

#define p_cdname   __p_cdname

Definition at line 286 of file resolv.h.

#define p_cdnname   __p_cdnname

Definition at line 287 of file resolv.h.

#define p_class   __p_class

Definition at line 288 of file resolv.h.

#define p_fqname   __p_fqname

Definition at line 289 of file resolv.h.

#define p_fqnname   __p_fqnname

Definition at line 290 of file resolv.h.

#define p_option   __p_option

Definition at line 291 of file resolv.h.

#define p_query   __p_query

Definition at line 249 of file resolv.h.

#define p_rcode   __p_rcode

Definition at line 296 of file resolv.h.

#define p_secstodate   __p_secstodate

Definition at line 292 of file resolv.h.

#define p_section   __p_section

Definition at line 293 of file resolv.h.

#define p_time   __p_time

Definition at line 294 of file resolv.h.

#define p_type   __p_type

Definition at line 295 of file resolv.h.

#define putlong   __putlong

Definition at line 297 of file resolv.h.

#define putshort   __putshort

Definition at line 298 of file resolv.h.

#define RES_AAONLY   0x00000004 /* authoritative answers only (!IMPL)*/

Definition at line 197 of file resolv.h.

#define RES_BLAST   0x00020000 /* blast all recursive servers */

Definition at line 212 of file resolv.h.

#define res_close   __res_close

Definition at line 250 of file resolv.h.

#define RES_DEBUG   0x00000002 /* print debug messages */

Definition at line 196 of file resolv.h.

Definition at line 217 of file resolv.h.

#define RES_DEFNAMES   0x00000080 /* use default domain name */

Definition at line 202 of file resolv.h.

#define RES_DFLRETRY   2 /* Default #/tries. */

Definition at line 101 of file resolv.h.

#define res_dnok   __res_dnok

Definition at line 299 of file resolv.h.

#define RES_DNSRCH   0x00000200 /* search up local domain tree */

Definition at line 204 of file resolv.h.

#define RES_EXHAUSTIVE   0x00000001 /* always do all queries */

Definition at line 190 of file resolv.h.

#define RES_F_CONN   0x00000002 /* socket is connected */

Definition at line 186 of file resolv.h.

#define RES_F_EDNS0ERR   0x00000004 /* EDNS0 caused errors */

Definition at line 187 of file resolv.h.

#define RES_F_VC   0x00000001 /* socket is TCP */

Definition at line 185 of file resolv.h.

#define res_hnok   __res_hnok

Definition at line 300 of file resolv.h.

#define res_hostalias   __res_hostalias

Definition at line 301 of file resolv.h.

#define RES_IGNTC   0x00000020 /* ignore trucation errors */

Definition at line 200 of file resolv.h.

#define RES_INIT   0x00000001 /* address initialized */

Definition at line 195 of file resolv.h.

#define res_init   __res_init

Definition at line 251 of file resolv.h.

#define RES_INSECURE1   0x00000400 /* type 1 security disabled */

Definition at line 205 of file resolv.h.

#define RES_INSECURE2   0x00000800 /* type 2 security disabled */

Definition at line 206 of file resolv.h.

#define res_isourserver   __res_isourserver

Definition at line 252 of file resolv.h.

#define RES_KEEPTSIG   0x00010000 /* do not strip TSIG records */

Definition at line 211 of file resolv.h.

#define res_mailok   __res_mailok

Definition at line 302 of file resolv.h.

#define RES_MAXNDOTS   15 /* should reflect bit field size */

Definition at line 98 of file resolv.h.

#define RES_MAXRETRANS   30 /* only for resolv.conf/RES_OPTIONS */

Definition at line 99 of file resolv.h.

#define RES_MAXRETRY   5 /* only for resolv.conf/RES_OPTIONS */

Definition at line 100 of file resolv.h.

#define RES_MAXTIME   65535 /* Infinity, in milliseconds. */

Definition at line 102 of file resolv.h.

#define res_mkquery   __res_mkquery

Definition at line 253 of file resolv.h.

#define res_nameinquery   __res_nameinquery

Definition at line 303 of file resolv.h.

#define res_nclose   __res_nclose

Definition at line 304 of file resolv.h.

#define res_ninit   __res_ninit

Definition at line 305 of file resolv.h.

#define res_nisourserver   __res_nisourserver

Definition at line 312 of file resolv.h.

#define res_nmkquery   __res_nmkquery

Definition at line 306 of file resolv.h.

#define RES_NOALIASES   0x00001000 /* shuts off HOSTALIASES feature */

Definition at line 207 of file resolv.h.

#define RES_NOCHECKNAME   0x00008000 /* do not check names for sanity. */

Definition at line 210 of file resolv.h.

#define RES_NOIP6DOTINT
Value:
0x00080000    /* Do not use .ip6.int in IPv6
                                      reverse lookup */

Definition at line 214 of file resolv.h.

#define res_npquery   __res_npquery

Definition at line 307 of file resolv.h.

#define res_nquery   __res_nquery

Definition at line 308 of file resolv.h.

#define res_nquerydomain   __res_nquerydomain

Definition at line 309 of file resolv.h.

#define res_nsearch   __res_nsearch

Definition at line 310 of file resolv.h.

#define res_nsend   __res_nsend

Definition at line 311 of file resolv.h.

#define res_ownok   __res_ownok

Definition at line 313 of file resolv.h.

#define RES_PRF_ADD   0x00000080

Definition at line 229 of file resolv.h.

#define RES_PRF_ANS   0x00000020

Definition at line 227 of file resolv.h.

#define RES_PRF_AUTH   0x00000040

Definition at line 228 of file resolv.h.

#define RES_PRF_CLASS   0x00000004

Definition at line 224 of file resolv.h.

#define RES_PRF_CMD   0x00000008

Definition at line 225 of file resolv.h.

#define RES_PRF_HEAD1   0x00000100

Definition at line 230 of file resolv.h.

#define RES_PRF_HEAD2   0x00000200

Definition at line 231 of file resolv.h.

#define RES_PRF_HEADX   0x00000800

Definition at line 233 of file resolv.h.

#define RES_PRF_INIT   0x00004000

Definition at line 236 of file resolv.h.

#define RES_PRF_QUERY   0x00001000

Definition at line 234 of file resolv.h.

#define RES_PRF_QUES   0x00000010

Definition at line 226 of file resolv.h.

#define RES_PRF_REPLY   0x00002000

Definition at line 235 of file resolv.h.

#define RES_PRF_STATS   0x00000001

Definition at line 222 of file resolv.h.

#define RES_PRF_TTLID   0x00000400

Definition at line 232 of file resolv.h.

#define RES_PRF_UPDATE   0x00000002

Definition at line 223 of file resolv.h.

#define RES_PRIMARY   0x00000010 /* query primary server only (!IMPL) */

Definition at line 199 of file resolv.h.

#define res_queriesmatch   __res_queriesmatch

Definition at line 314 of file resolv.h.

#define res_query   __res_query

Definition at line 254 of file resolv.h.

#define res_querydomain   __res_querydomain

Definition at line 255 of file resolv.h.

#define res_randomid   __res_randomid

Definition at line 315 of file resolv.h.

#define RES_RECURSE   0x00000040 /* recursion desired */

Definition at line 201 of file resolv.h.

#define RES_ROTATE   0x00004000 /* rotate ns list after each query */

Definition at line 209 of file resolv.h.

#define res_search   __res_search

Definition at line 256 of file resolv.h.

#define res_send   __res_send

Definition at line 257 of file resolv.h.

#define RES_STAYOPEN   0x00000100 /* Keep TCP socket open */

Definition at line 203 of file resolv.h.

#define RES_TIMEOUT   5 /* min. seconds between retries */

Definition at line 96 of file resolv.h.

#define RES_USE_EDNS0   0x00100000 /* Use EDNS0. */

Definition at line 215 of file resolv.h.

#define RES_USE_INET6   0x00002000 /* use/map IPv6 in gethostbyname() */

Definition at line 208 of file resolv.h.

#define RES_USEBSTRING
Value:
0x00040000    /* IPv6 reverse lookup with byte
                                      strings */

Definition at line 213 of file resolv.h.

#define RES_USEVC   0x00000008 /* use virtual circuit */

Definition at line 198 of file resolv.h.

#define sym_ntop   __sym_ntop

Definition at line 316 of file resolv.h.

#define sym_ntos   __sym_ntos

Definition at line 317 of file resolv.h.

#define sym_ston   __sym_ston

Definition at line 318 of file resolv.h.


Typedef Documentation

typedef res_sendhookact(* res_send_qhook)(struct sockaddr_in *const *ns, const u_char **query, int *querylen, u_char *ans, int anssiz, int *resplen)

Definition at line 74 of file resolv.h.

typedef res_sendhookact(* res_send_rhook)(const struct sockaddr_in *ns, const u_char *query, int querylen, u_char *ans, int anssiz, int *resplen)

Definition at line 81 of file resolv.h.

typedef struct __res_state* res_state

Definition at line 151 of file resolv.h.


Enumeration Type Documentation

Enumerator:
res_goahead 
res_nextns 
res_modified 
res_done 
res_error 

Definition at line 71 of file resolv.h.


Function Documentation

__BEGIN_DECLS struct __res_state* __res_state ( void  ) const [read]

Definition at line 42 of file errno.c.

{
  pthread_descr self = thread_self();
  return THREAD_GETMEM (self, p_resp);
}
int b64_ntop ( u_char const ,
size_t  ,
char *  ,
size_t   
)

Definition at line 131 of file base64.c.

                                                                             {
       size_t datalength = 0;
       u_char input[3];
       u_char output[4];
       size_t i;

       while (2 < srclength) {
              input[0] = *src++;
              input[1] = *src++;
              input[2] = *src++;
              srclength -= 3;

              output[0] = input[0] >> 2;
              output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
              output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
              output[3] = input[2] & 0x3f;
              Assert(output[0] < 64);
              Assert(output[1] < 64);
              Assert(output[2] < 64);
              Assert(output[3] < 64);

              if (datalength + 4 > targsize)
                     return (-1);
              target[datalength++] = Base64[output[0]];
              target[datalength++] = Base64[output[1]];
              target[datalength++] = Base64[output[2]];
              target[datalength++] = Base64[output[3]];
       }

       /* Now we worry about padding. */
       if (0 != srclength) {
              /* Get what's left. */
              input[0] = input[1] = input[2] = '\0';
              for (i = 0; i < srclength; i++)
                     input[i] = *src++;

              output[0] = input[0] >> 2;
              output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
              output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
              Assert(output[0] < 64);
              Assert(output[1] < 64);
              Assert(output[2] < 64);

              if (datalength + 4 > targsize)
                     return (-1);
              target[datalength++] = Base64[output[0]];
              target[datalength++] = Base64[output[1]];
              if (srclength == 1)
                     target[datalength++] = Pad64;
              else
                     target[datalength++] = Base64[output[2]];
              target[datalength++] = Pad64;
       }
       if (datalength >= targsize)
              return (-1);
       target[datalength] = '\0';  /* Returned value doesn't count \0. */
       return (datalength);
}
int b64_pton ( char const ,
u_char ,
size_t   
)
int dn_comp ( const char *  ,
u_char ,
int  ,
u_char **  ,
u_char **   
)
int dn_count_labels ( const char *  )

Here is the caller graph for this function:

int dn_expand ( const u_char ,
const u_char ,
const u_char ,
char *  ,
int   
)

Definition at line 90 of file res_comp.c.

{
       int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);

       if (n > 0 && dst[0] == '.')
              dst[0] = '\0';
       return (n);
}

Here is the call graph for this function:

int dn_skipname ( const u_char ,
const u_char  
)

Here is the caller graph for this function:

__BEGIN_DECLS void fp_nquery ( const u_char ,
int  ,
FILE  
)

Here is the caller graph for this function:

void fp_query ( const u_char ,
FILE  
)

Definition at line 139 of file res_data.c.

                                        {
       fp_nquery(msg, PACKETSZ, file);
}

Here is the call graph for this function:

void fp_resstat ( const res_state  ,
FILE  
)

Definition at line 127 of file res_debug.c.

                                              {
       u_long mask;

       fprintf(file, ";; res options:");
       for (mask = 1;  mask != 0;  mask <<= 1)
              if (statp->options & mask)
                     fprintf(file, " %s", p_option(mask));
       putc('\n', file);
}

Here is the call graph for this function:

const char* hostalias ( const char *  )

Definition at line 298 of file res_data.c.

                            {
       static char abuf[MAXDNAME];

       return (res_hostalias(&_res, name, abuf, sizeof abuf));
}

Here is the call graph for this function:

int loc_aton ( const char *  ascii,
u_char binary 
)
const char* loc_ntoa ( const u_char binary,
char *  ascii 
)
const u_char* p_cdname ( const u_char ,
const u_char ,
FILE  
)
const u_char* p_cdnname ( const u_char ,
const u_char ,
int  ,
FILE  
)

Definition at line 287 of file res_debug.c.

                                                                    {
       char name[MAXDNAME];
       int n;

       if ((n = dn_expand(msg, msg + len, cp, name, sizeof name)) < 0)
              return (NULL);
       if (name[0] == '\0')
              putc('.', file);
       else
              fputs(name, file);
       return (cp + n);
}

Here is the call graph for this function:

const char* p_class ( int  )

Definition at line 560 of file res_debug.c.

                   {
       return (sym_ntos(__p_class_syms, class, (int *)0));
}
const u_char* p_fqname ( const u_char ,
const u_char ,
FILE  
)
const u_char* p_fqnname ( const u_char cp,
const u_char msg,
int  ,
char *  ,
int   
)
const char* p_option ( u_long  option)

Here is the caller graph for this function:

void p_query ( const u_char )

Definition at line 134 of file res_data.c.

                           {
       fp_query(msg, stdout);
}
const char* p_rcode ( int  )

Definition at line 612 of file res_debug.c.

                   {
       return (sym_ntos(__p_rcode_syms, rcode, (int *)0));
}
char* p_secstodate ( u_long  )

Here is the caller graph for this function:

const char* p_section ( int  section,
int  opcode 
)

Here is the caller graph for this function:

const char* p_time ( u_int32_t  )
const char* p_type ( int  )

Definition at line 533 of file res_debug.c.

                 {
       return (sym_ntos(__p_type_syms, type, (int *)0));
}
void putlong ( u_int32_t  ,
u_char  
)
void putshort ( u_int16_t  ,
u_char  
)
void res_close ( void  )

Definition at line 237 of file res_data.c.

                {
#ifdef _LIBC
       /*
        * Some stupid programs out there call res_close() before res_init().
        * Since _res._vcsock isn't explicitly initialized, these means that
        * we could do a close(0), which might lead to some security problems.
        * Therefore we check if res_init() was called before by looking at
        * the RES_INIT bit in _res.options.  If it hasn't been set we bail out
        * early.  */
       if ((_res.options & RES_INIT) == 0)
         return;
#endif
       /* We don't free the name server addresses because we never
          did it and it would be done implicitly on shutdown.  */
       __res_iclose(&_res, false);
}

Here is the call graph for this function:

int res_dnok ( const char *  )

Definition at line 226 of file res_comp.c.

                         {
       int ch;

       while ((ch = *dn++) != '\0')
              if (!domainchar(ch))
                     return (0);
       return (1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* res_hostalias ( const res_state  ,
const char *  ,
char *  ,
size_t   
)

Here is the caller graph for this function:

int res_init ( void  )

Definition at line 45 of file res_libc.c.

               {
       extern int __res_vinit(res_state, int);

       /*
        * These three fields used to be statically initialized.  This made
        * it hard to use this code in a shared library.  It is necessary,
        * now that we're doing dynamic initialization here, that we preserve
        * the old semantics: if an application modifies one of these three
        * fields of _res before res_init() is called, res_init() will not
        * alter them.  Of course, if an application is setting them to
        * _zero_ before calling res_init(), hoping to override what used
        * to be the static default, we can't detect it and unexpected results
        * will follow.  Zero for any of these fields would make no sense,
        * so one can safely assume that the applications were already getting
        * unexpected results.
        *
        * _res.options is tricky since some apps were known to diddle the bits
        * before res_init() was first called. We can't replicate that semantic
        * with dynamic initialization (they may have turned bits off that are
        * set in RES_DEFAULT).  Our solution is to declare such applications
        * "broken".  They could fool us by setting RES_INIT but none do (yet).
        */
       if (!_res.retrans)
              _res.retrans = RES_TIMEOUT;
       if (!_res.retry)
              _res.retry = 4;
       if (!(_res.options & RES_INIT))
              _res.options = RES_DEFAULT;
       else if (_res.nscount > 0)
              __res_iclose (&_res, true); /* Close any VC sockets.  */

       /*
        * This one used to initialize implicitly to zero, so unless the app
        * has set it to something in particular, we can randomize it now.
        */
       if (!_res.id)
              _res.id = res_randomid();

       atomicinclock (lock);
       /* Request all threads to re-initialize their resolver states,
          resolv.conf might have changed.  */
       atomicinc (__res_initstamp);
       atomicincunlock (lock);

       return (__res_vinit(&_res, 1));
}

Here is the call graph for this function:

Definition at line 208 of file res_data.c.

                                               {
       return (res_ourserver_p(&_res, (const struct sockaddr_in6 *) inp));
}

Here is the call graph for this function:

int res_mailok ( const char *  )

Definition at line 198 of file res_comp.c.

                           {
       int ch, escaped = 0;

       /* "." is a valid missing representation */
       if (*dn == '\0')
              return (1);

       /* otherwise <label>.<hostname> */
       while ((ch = *dn++) != '\0') {
              if (!domainchar(ch))
                     return (0);
              if (!escaped && periodchar(ch))
                     break;
              if (escaped)
                     escaped = 0;
              else if (bslashchar(ch))
                     escaped = 1;
       }
       if (periodchar(ch))
              return (res_hnok(dn));
       return (0);
}

Here is the call graph for this function:

int res_mkquery ( int  ,
const char *  ,
int  ,
int  ,
const u_char ,
int  ,
const u_char ,
u_char ,
int   
)
int res_nameinquery ( const char *  ,
int  ,
int  ,
const u_char ,
const u_char  
)

Definition at line 257 of file res_send.c.

{
       const u_char *cp = buf + HFIXEDSZ;
       int qdcount = ntohs(((HEADER*)buf)->qdcount);

       while (qdcount-- > 0) {
              char tname[MAXDNAME+1];
              int n, ttype, tclass;

              n = dn_expand(buf, eom, cp, tname, sizeof tname);
              if (n < 0)
                     return (-1);
              cp += n;
              if (cp + 2 * INT16SZ > eom)
                     return (-1);
              NS_GET16(ttype, cp);
              NS_GET16(tclass, cp);
              if (ttype == type && tclass == class &&
                  ns_samename(tname, name) == 1)
                     return (1);
       }
       return (0);
}

Here is the call graph for this function:

void res_nclose ( res_state  )

Here is the caller graph for this function:

Here is the caller graph for this function:

int res_nmkquery ( res_state  ,
int  ,
const char *  ,
int  ,
int  ,
const u_char ,
int  ,
const u_char ,
u_char ,
int   
)

Definition at line 96 of file res_mkquery.c.

{
       register HEADER *hp;
       register u_char *cp;
       register int n;
       u_char *dnptrs[20], **dpp, **lastdnptr;

#ifdef DEBUG
       if (statp->options & RES_DEBUG)
              printf(";; res_nmkquery(%s, %s, %s, %s)\n",
                     _res_opcodes[op], dname, p_class(class), p_type(type));
#endif
       /*
        * Initialize header fields.
        */
       if ((buf == NULL) || (buflen < HFIXEDSZ))
              return (-1);
       memset(buf, 0, HFIXEDSZ);
       hp = (HEADER *) buf;
       /* We randomize the IDs every time.  The old code just
          incremented by one after the initial randomization which
          still predictable if the application does multiple
          requests.  */
       int randombits;
       do
         {
#ifdef RANDOM_BITS
           RANDOM_BITS (randombits);
#else
           struct timeval tv;
           __gettimeofday (&tv, NULL);
           randombits = (tv.tv_sec << 8) ^ tv.tv_usec;
#endif
         }
       while ((randombits & 0xffff) == 0);
       statp->id = (statp->id + randombits) & 0xffff;
       hp->id = statp->id;
       hp->opcode = op;
       hp->rd = (statp->options & RES_RECURSE) != 0;
       hp->rcode = NOERROR;
       cp = buf + HFIXEDSZ;
       buflen -= HFIXEDSZ;
       dpp = dnptrs;
       *dpp++ = buf;
       *dpp++ = NULL;
       lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
       /*
        * perform opcode specific processing
        */
       switch (op) {
       case NS_NOTIFY_OP:
              if ((buflen -= QFIXEDSZ + (data == NULL ? 0 : RRFIXEDSZ)) < 0)
                     return (-1);
              goto compose;

       case QUERY:
              if ((buflen -= QFIXEDSZ) < 0)
                     return (-1);
       compose:
              n = ns_name_compress(dname, cp, buflen,
                                 (const u_char **) dnptrs,
                                 (const u_char **) lastdnptr);
              if (n < 0)
                     return (-1);
              cp += n;
              buflen -= n;
              NS_PUT16 (type, cp);
              NS_PUT16 (class, cp);
              hp->qdcount = htons(1);
              if (op == QUERY || data == NULL)
                     break;
              /*
               * Make an additional record for completion domain.
               */
              n = ns_name_compress((char *)data, cp, buflen,
                                 (const u_char **) dnptrs,
                                 (const u_char **) lastdnptr);
              if (__builtin_expect (n < 0, 0))
                     return (-1);
              cp += n;
              buflen -= n;
              NS_PUT16 (T_NULL, cp);
              NS_PUT16 (class, cp);
              NS_PUT32 (0, cp);
              NS_PUT16 (0, cp);
              hp->arcount = htons(1);
              break;

       case IQUERY:
              /*
               * Initialize answer section
               */
              if (__builtin_expect (buflen < 1 + RRFIXEDSZ + datalen, 0))
                     return (-1);
              *cp++ = '\0'; /* no domain name */
              NS_PUT16 (type, cp);
              NS_PUT16 (class, cp);
              NS_PUT32 (0, cp);
              NS_PUT16 (datalen, cp);
              if (datalen) {
                     memcpy(cp, data, datalen);
                     cp += datalen;
              }
              hp->ancount = htons(1);
              break;

       default:
              return (-1);
       }
       return (cp - buf);
}

Here is the call graph for this function:

void res_npquery ( const res_state  ,
const u_char ,
int  ,
FILE  
)
int res_nquery ( res_state  ,
const char *  ,
int  ,
int  ,
u_char ,
int   
)

Here is the caller graph for this function:

int res_nquerydomain ( res_state  ,
const char *  ,
const char *  ,
int  ,
int  ,
u_char ,
int   
)

Definition at line 575 of file res_query.c.

{
       return __libc_res_nquerydomain(statp, name, domain, class, type,
                                   answer, anslen, NULL, NULL, NULL, NULL);
}

Here is the call graph for this function:

int res_nsearch ( res_state  ,
const char *  ,
int  ,
int  ,
u_char ,
int   
)

Here is the caller graph for this function:

int res_nsend ( res_state  ,
const u_char ,
int  ,
u_char ,
int   
)

Definition at line 637 of file res_send.c.

{
  return __libc_res_nsend(statp, buf, buflen, NULL, 0, ans, anssiz,
                       NULL, NULL, NULL, NULL);
}
int res_ownok ( const char *  )

Here is the caller graph for this function:

int res_query ( const char *  ,
int  ,
int  ,
u_char ,
int   
)

Definition at line 185 of file res_data.c.

{
       if (__res_maybe_init (&_res, 1) == -1) {
              RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
              return (-1);
       }
       return (res_nquery(&_res, name, class, type, answer, anslen));
}

Here is the call graph for this function:

int res_querydomain ( const char *  ,
const char *  ,
int  ,
int  ,
u_char ,
int   
)

Definition at line 281 of file res_data.c.

{
       if (__res_maybe_init (&_res, 1) == -1) {
              RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
              return (-1);
       }

       return (res_nquerydomain(&_res, name, domain,
                             class, type,
                             answer, anslen));
}

Here is the call graph for this function:

u_int res_randomid ( void  )

Definition at line 570 of file res_init.c.

                   {
       return 0xffff & __getpid();
}
int res_search ( const char *  ,
int  ,
int  ,
u_char ,
int   
)

Definition at line 267 of file res_data.c.

{
       if (__res_maybe_init (&_res, 1) == -1) {
              RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
              return (-1);
       }

       return (res_nsearch(&_res, name, class, type, answer, anslen));
}

Here is the call graph for this function:

int res_send ( const u_char ,
int  ,
u_char ,
int   
)

Definition at line 213 of file res_data.c.

                                                                 {
       if (__res_maybe_init (&_res, 1) == -1) {
              /* errno should have been set by res_init() in this case. */
              return (-1);
       }

       return (res_nsend(&_res, buf, buflen, ans, anssiz));
}

Here is the call graph for this function:

const char* sym_ntop ( const struct res_sym ,
int  ,
int  
)
const char* sym_ntos ( const struct res_sym ,
int  ,
int  
)

Definition at line 494 of file res_debug.c.

                                                               {
       static char unname[20];

       for ((void)NULL; syms->name != 0; syms++) {
              if (number == syms->number) {
                     if (success)
                            *success = 1;
                     return (syms->name);
              }
       }

       sprintf(unname, "%d", number);            /* XXX nonreentrant */
       if (success)
              *success = 0;
       return (unname);
}
int sym_ston ( const struct res_sym ,
const char *  ,
int  
)

Definition at line 480 of file res_debug.c.

                                                                     {
       for ((void)NULL; syms->name != 0; syms++) {
              if (strcasecmp (name, syms->name) == 0) {
                     if (success)
                            *success = 1;
                     return (syms->number);
              }
       }
       if (success)
              *success = 0;
       return (syms->number);             /* The default value. */
}

Here is the call graph for this function: