dns.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
#ifndef _DNS_H
00046 #define _DNS_H 1
00047 
00048 
#include "../../config.h"    
00049 
#include <stdio.h>           
00050 
#include <string.h>          
00051 
#include <strings.h>         
00052 
#include <sys/socket.h>      
00053 
#include <netinet/in.h>      
00054 
#include <arpa/nameser.h>    
00055 
#include <resolv.h>          
00056 
#include <netdb.h>           
00057 
#include <arpa/inet.h>       
00058 
00059 
#ifdef _WITH_DARWINPPC
00060 
#include <nameser8_compat.h> 
00061 
#endif 
00062 
00063 
#ifdef _WITH_PTHREADS
00064 
#include <pthread.h>         
00065 
#endif 
00066 
00067 
#ifdef HAVE__BEGIN_DECLS
00068 
__BEGIN_DECLS
00069 
#else
00070 
# ifdef __cplusplus
00071 
extern "C" {
00072 
# endif 
00073 
#endif 
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087 #define SPF_PACKETSZ  8192
00088 #define SPF_MAXDNAME  1025
00089 #define SPF_MAXCDNAME 255
00090 
00091 
extern int h_errno;
00092 
00093 
#ifndef HPUX
00094 
struct hostent;
00095 
#endif 
00096 
00097 
void _DNS_gethostbyname_r_free(
void);
00098 
00099 
#ifdef _WITH_PTHREADS
00100 
  
00101 
  #ifdef HAVE_GETHOSTBYNAME_R
00102 
00103     
struct hostent *_DNS_GNU_gethostbyname_r(
const char *name, 
struct hostent *result,
00104       
char *buf, 
int buflen, 
int *h_errnop);
00105 
00106 
    #define xgethostbyname(a, b, c, d, e) _DNS_GNU_gethostbyname_r((a), (b), (c), (d), (e))
00107 
    #define xgethostbyname_free()
00108 
00109 
  #else
00110 
    extern pthread_mutex_t 
dns_mutex;
00111 
00112     
struct hostent *_DNS_gethostbyname_r(
const char *name, 
struct hostent *result,
00113       
char *buf, 
int buflen, 
int *h_errnop);
00114 
00115 
    #define xgethostbyname(a, b, c, d, e) _DNS_gethostbyname_r((a), (b), (c), (d), (e))
00116 
    #define xgethostbyname_free()         _DNS_gethostbyname_r_free()
00117 
00118 
  #endif 
00119 
#else 
00120 
00121   #define xgethostbyname(a, b, c, d, e) gethostbyname((a))
00122   #define xgethostbyname_free()
00123 
00124 
#endif 
00125 
00126 
00127 
00128 
#ifdef SCO
00129 
#undef h_errno
00130 
#define h_errno errno
00131 
#endif 
00132 
00133 
char    *
DNS_query(
peer_info_t *, 
const char *, 
const int T_TYPE, 
const char *);
00134 
char    *
DNS_txt_answer(int16_t, 
const u_char *, 
const u_char *, u_char *,
00135                         
char *, 
int *);
00136 
char    *
DNS_mx_answer(int16_t, 
const u_char *, 
const u_char *, u_char *,
00137                        
char *, 
int *);
00138 
SPF_BOOL DNS_ptr_answer(
peer_info_t *, int16_t, 
const u_char *, 
const u_char *,
00139                         u_char *, 
char *, 
const char *, 
int *);
00140 
char    *
DNS_cname_answer(int16_t, 
const u_char *, 
const u_char *,
00141                           u_char *, 
char *, 
int *);
00142 
SPF_BOOL DNS_check_client_reverse(
peer_info_t *);
00143 
00144 
00145 
#ifdef  HAVE__BEGIN_DECLS
00146 
__END_DECLS 
00147 
#else
00148 
# ifdef __cplusplus
00149 
}
00150 
# endif 
00151 
#endif 
00152 
00153 
#endif 
00154 
00155 
Generated on Thu Sep 16 18:10:46 2004 for libSPF v1.0 by
 1.3.8
 1.3.8