37# include <netinet/in.h>
38# include <arpa/inet.h>
47 const char *bef, *aft;
119 if (vb->
avail >= want)
return 1;
120 nb=
realloc(vb->
buf, (
size_t) want);
if (!nb)
return 0;
136 if (vb->
avail < newlen) {
137 if (newlen<20) newlen= 20;
163 vbuf *vb,
const byte *dgram,
int dglen,
int cbyte) {
168 return "<cannot report domain... out of memory>";
176 return "<cannot report bad format... out of memory>";
183 return (
char*)vb->
buf;
187 const char **rrtname_r,
const char **fmtname_r,
189 const void *datap,
char **data_r) {
197 if (rrtname_r) *rrtname_r= typei->
rrtname;
198 if (fmtname_r) *fmtname_r= typei->
fmtname;
199 if (len_r) *len_r= typei->
rrsz;
205 if (st)
goto x_freevb;
209 if (!*data_r) *data_r= (
char*)vb.
buf;
218#define SINFO(n,s) { adns_s_##n, #n, s }
227 SINFO( nomemory,
"Out of memory" ),
228 SINFO( unknownrrtype,
"Query not implemented in DNS library" ),
229 SINFO( systemfail,
"General resolver or system failure" ),
232 SINFO( allservfail,
"All nameservers failed" ),
233 SINFO( norecurse,
"Recursion denied by nameserver" ),
234 SINFO( invalidresponse,
"Nameserver sent bad response" ),
235 SINFO( unknownformat,
"Nameserver used unknown format" ),
237 SINFO( rcodeservfail,
"Nameserver reports failure" ),
238 SINFO( rcodeformaterror,
"Query not understood by nameserver" ),
239 SINFO( rcodenotimplemented,
"Query not implemented by nameserver" ),
240 SINFO( rcoderefused,
"Query refused by nameserver" ),
241 SINFO( rcodeunknown,
"Nameserver sent unknown response code" ),
243 SINFO( inconsistent,
"Inconsistent resource records in DNS" ),
244 SINFO( prohibitedcname,
"DNS alias found where canonical name wanted" ),
245 SINFO( answerdomaininvalid,
"Found syntactically invalid domain name" ),
246 SINFO( answerdomaintoolong,
"Found overly-long domain name" ),
247 SINFO( invaliddata,
"Found invalid DNS data" ),
249 SINFO( querydomainwrong,
"Domain invalid for particular DNS query type" ),
250 SINFO( querydomaininvalid,
"Domain name is syntactically invalid" ),
251 SINFO( querydomaintoolong,
"Domain name or component is too long" ),
253 SINFO( nxdomain,
"No such domain" ),
254 SINFO( nodata,
"No such data" )
261 return *
st < si->
st ? -1 : *
st > si->
st ? 1 : 0;
269 const struct sinfo *si;
276 const struct sinfo *si;
283#define STINFO(max) { adns_s_max_##max, #max }
308 return here <
min ? -1 : here >
max ? 1 : 0;
320 int (*needswap)(
void *
context,
const void *
a,
const void *
b),
325 for (
i=0;
i<nobjs;
i++) {
341#ifndef ADNS_JGAA_WIN32
348 sigfillset(&toblock);
352 sigfillset(&
sa.sa_mask);
361#ifndef ADNS_JGAA_WIN32
ACPI_SIZE strlen(const char *String)
static struct sockaddr_in sa
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static int sti_compar(const void *key, const void *elem)
const char * adns_strerror(adns_status st)
int adns__vbuf_append(vbuf *vb, const byte *data, int len)
void adns__sigpipe_protect(adns_state ads)
void adns__vbuf_appendq(vbuf *vb, const byte *data, int len)
void adns__vbuf_init(vbuf *vb)
void adns__debug(adns_state ads, int serv, adns_query qu, const char *fmt,...)
static int si_compar(const void *key, const void *elem)
adns_status adns_rr_info(adns_rrtype type, const char **rrtname_r, const char **fmtname_r, int *len_r, const void *datap, char **data_r)
static const struct sinfo sinfos[]
void adns__vbuf_free(vbuf *vb)
const char * adns_errtypeabbrev(adns_status st)
const char * adns_errabbrev(adns_status st)
static const struct sinfo * findsinfo(adns_status st)
void adns__sigpipe_unprotect(adns_state ads)
void adns__warn(adns_state ads, int serv, adns_query qu, const char *fmt,...)
const char * adns__diag_domain(adns_state ads, int serv, adns_query qu, vbuf *vb, const byte *dgram, int dglen, int cbyte)
static const struct stinfo stinfos[]
int adns__vbuf_ensure(vbuf *vb, int want)
void adns__vdiag(adns_state ads, const char *pfx, adns_initflags prevent, int serv, adns_query qu, const char *fmt, va_list al)
void adns__isort(void *array, int nobjs, int sz, void *tempbuf, int(*needswap)(void *context, const void *a, const void *b), void *context)
int adns__vbuf_appendstr(vbuf *vb, const char *data)
void adns__diag(adns_state ads, int serv, adns_query qu, const char *fmt,...)
const typeinfo * adns__findtype(adns_rrtype type)
adns_status adns__parse_domain(adns_state ads, int serv, adns_query qu, vbuf *vb, adns_queryflags flags, const byte *dgram, int dglen, int *cbyte_io, int max)
struct adns__state::server servers[MAXSERVERS]
struct sigaction stdsigpipe
adns_status(* convstring)(vbuf *vb, const void *data)