34# include <netinet/in.h>
40#define R_NOMEM return adns_s_nomemory
41#define CSP_ADDSTR(s) do { if (!adns__vbuf_appendstr(vb,(s))) R_NOMEM; } while (0)
85 int *len_r,
char **str_r) {
89 const byte *dgram= pai->
dgram;
122 }
else if (ch ==
'"') {
124 }
else if (ch >= 32 && ch <= 126) {
166 for (
tc=0, te= *rrp; te->
i >= 0; te++,
tc++);
170 for (te= *rrp; te->
i >= 0; te++)
180 const byte *dgram= pai->
dgram;
181 int ti,
tc,
l, startbyte;
197 for (
cbyte=startbyte, ti=0, te=
table; ti<
tc; ti++, te++) {
242 struct in_addr *storeto= datap;
250 const struct sortlist *slp;
254 i<ads->nsortlist && !((ad.
s_addr & slp->mask.s_addr) == slp->base.s_addr);
270 const struct in_addr *
ap= datap_a, *bp= datap_b;
276 const struct in_addr *rrp= datap, rr= *rrp;
290 const byte *dgram= pai->
dgram;
304 return dip_inaddr(
ads,
ap->addr.inet.sin_addr, bp->addr.inet.sin_addr);
317 switch (rrp->
addr.
inet.sin_family) {
369 const char *
const *domainp= datap;
405 int *cbyte_io,
int count,
int dmstart) {
407 int type,
class, rdlen, rdstart, ownermatched;
411 for (rri=0, naddrs=-1; rri<
count; rri++) {
413 &
type, &
class, &ttl, &rdlen, &rdstart,
414 pai->
dgram, pai->
dglen, dmstart, &ownermatched);
417 if (naddrs>0)
break;
else continue;
424 st=
pa_addr(pai, rdstart,rdstart+rdlen,
454 if (
parent->children.head) {
470 dmstart=
cbyte= *cbyte_io;
497 ctx.info.hostaddr= rrp;
524 if (
ap->astatus != bp->
astatus)
return ap->astatus;
525 if (
ap->astatus)
return 0;
530 ap->addrs[0].addr.inet.sin_addr,
599 const byte *dgram= pai->
dgram;
618 if (
ap->i < bp->i)
return 0;
619 if (
ap->i > bp->i)
return 1;
628 const byte *dgram= pai->
dgram;
646 if (
ap->i < bp->i)
return 0;
647 if (
ap->i > bp->i)
return 1;
697 }
else if (cans->
status) {
702 queried= &
parent->ctx.info.ptr_parent_addr;
703 for (
i=0, found=cans->
rrs.
addr; i<cans->nrrs;
i++, found++) {
704 if (queried->
len == found->
len &&
706 if (!
parent->children.head) {
744 for (
i=0;
i<4;
i++) {
752 for (
i=0;
i<(
int)
sizeof(expectdomain)/(
int)
sizeof(*expectdomain);
i++) {
764 ap->addr.inet.sin_addr.s_addr=
765 htonl((
u_long)(ipv[0]<<24) | (ipv[1]<<16) | (ipv[2]<<8) | (ipv[3]));
817 for (
i=0;
i<2;
i++) {
833 int lablen, labstart,
i, needquote,
c,
r, neednorm;
834 const unsigned char *
p;
845 *cbyte_io, cbyte_io);
853 for (
i=0, needquote=0,
p= pai->
dgram+labstart;
i<lablen;
i++) {
856 if (
c ==
'.' && !neednorm) neednorm= 1;
861 if (needquote || neednorm) {
864 for (
i=0, needquote=0,
p= pai->
dgram+labstart;
i<lablen;
i++,
p++) {
935 const byte *dgram= pai->
dgram;
948 for (
i=0;
i<5;
i++) {
951 (&rrp->
serial)[
i]= (msw<<16) | lsw;
974 for (
i=0;
i<5;
i++) {
992#define TYPESZ_M(member) (sizeof(*((adns_answer*)0)->rrs.member))
994#define DEEP_MEMB(memb) TYPESZ_M(memb), mf_##memb, cs_##memb
995#define FLAT_MEMB(memb) TYPESZ_M(memb), mf_flat, cs_##memb
997#define DEEP_TYPE(code,rrt,fmt,memb,parser,comparer,printer) \
998 { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_##memb, printer, parser, comparer }
999#define FLAT_TYPE(code,rrt,fmt,memb,parser,comparer,printer) \
1000 { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_flat, printer, parser, comparer }
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
ADNS_API const char * adns_errtypeabbrev(adns_status st)
ADNS_API const char * adns_strerror(adns_status st)
@ adns_s_querydomainwrong
ADNS_API const char * adns_errabbrev(adns_status st)
@ adns_qf_quoteok_anshost
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
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
#define memcpy(s1, s2, n)
struct task_struct * current
#define sprintf(buf, format,...)
#define LIST_LINK_TAIL_PART(list, node, part)
#define LIST_LINK_TAIL(list, node)
int adns__vbuf_append(vbuf *vb, const byte *data, int len)
void adns__vbuf_appendq(vbuf *vb, const byte *data, int len)
int adns__vbuf_ensure(vbuf *vb, int want)
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__transfer_interim(adns_query from, adns_query to, void *block, size_t sz)
adns_status adns__findrr_anychk(adns_query qu, int serv, const byte *dgram, int dglen, int *cbyte_io, int *type_r, int *class_r, unsigned long *ttl_r, int *rdlen_r, int *rdstart_r, const byte *eo_dgram, int eo_dglen, int eo_cbyte, int *eo_matched_r)
adns_status adns__parse_domain_more(findlabel_state *fls, adns_state ads, adns_query qu, vbuf *vb, parsedomain_flags flags, const byte *dgram)
static int ctype_822special(int c)
adns_status adns__internal_submit(adns_state ads, adns_query *query_r, const typeinfo *typei, vbuf *qumsg_vb, int id, adns_queryflags flags, struct timeval now, const qcontext *ctx)
void * adns__alloc_interim(adns_query qu, size_t sz)
void adns__query_fail(adns_query qu, adns_status stat)
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)
adns_status adns__findlabel_next(findlabel_state *fls, int *lablen_r, int *labstart_r)
void adns__findlabel_start(findlabel_state *fls, adns_state ads, int serv, adns_query qu, const byte *dgram, int dglen, int max, int dmbegin, int *dmend_rlater)
adns_status adns__mkquery_frdgram(adns_state ads, vbuf *vb, int *id_r, const byte *qd_dgram, int qd_dglen, int qd_begin, adns_rrtype type, adns_queryflags flags)
void adns__makefinal_str(adns_query qu, char **strp)
void adns__makefinal_block(adns_query qu, void **blpp, size_t sz)
void adns__update_expires(adns_query qu, unsigned long ttl, struct timeval now)
void adns__query_done(adns_query qu)
struct adns__query::@4230 children
struct adns__state::sortlist sortlist[MAXSORTLIST]
union adns_answer::@4227 rrs
union adns_rr_addr::@4226 addr
union qcontext::@4228 info
adns_rr_addr ptr_parent_addr
static adns_status pa_txt(const parseinfo *pai, int cbyte, int max, void *datap)
static int dip_inaddr(adns_state ads, struct in_addr a, struct in_addr b)
const typeinfo * adns__findtype(adns_rrtype type)
static adns_status pap_qstring(const parseinfo *pai, int *cbyte_io, int max, int *len_r, char **str_r)
static adns_status csp_qstring(vbuf *vb, const char *dp, int len)
static adns_status cs_inaddr(vbuf *vb, const void *datap)
static void icb_hostaddr(adns_query parent, adns_query child)
static int dip_hostaddr(adns_state ads, const adns_rr_hostaddr *ap, const adns_rr_hostaddr *bp)
static void mf_strpair(adns_query qu, void *datap)
#define FLAT_TYPE(code, rrt, fmt, memb, parser, comparer, printer)
static adns_status pap_mailbox(const parseinfo *pai, int *cbyte_io, int max, char **mb_r)
static adns_status cs_addr(vbuf *vb, const void *datap)
static void mf_manyistr(adns_query qu, void *datap)
static adns_status pap_domain(const parseinfo *pai, int *cbyte_io, int max, char **domain_r, parsedomain_flags flags)
static adns_status cs_inthost(vbuf *vb, const void *datap)
static adns_status pa_mx_raw(const parseinfo *pai, int cbyte, int max, void *datap)
static adns_status pa_rp(const parseinfo *pai, int cbyte, int max, void *datap)
static adns_status csp_addr(vbuf *vb, const adns_rr_addr *rrp)
static void mf_flat(adns_query qu, void *data)
static adns_status pa_host_raw(const parseinfo *pai, int cbyte, int max, void *datap)
static void mf_soa(adns_query qu, void *datap)
static int div_addr(void *context, const void *datap_a, const void *datap_b)
static adns_status pa_mx(const parseinfo *pai, int cbyte, int max, void *datap)
static adns_status pa_ptr(const parseinfo *pai, int dmstart, int max, void *datap)
static adns_status cs_domain(vbuf *vb, const void *datap)
static int di_inaddr(adns_state ads, const void *datap_a, const void *datap_b)
static adns_status csp_domain(vbuf *vb, const char *domain)
static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io, int max, adns_rr_hostaddr *rrp)
static int di_mx_raw(adns_state ads, const void *datap_a, const void *datap_b)
static adns_status pa_hinfo(const parseinfo *pai, int cbyte, int max, void *datap)
static const typeinfo typeinfos[]
static int search_sortlist(adns_state ads, struct in_addr ad)
static adns_status pap_mailbox822(const parseinfo *pai, int *cbyte_io, int max, char **mb_r)
static adns_status pap_findaddrs(const parseinfo *pai, adns_rr_hostaddr *ha, int *cbyte_io, int count, int dmstart)
static adns_status pa_hostaddr(const parseinfo *pai, int cbyte, int max, void *datap)
static adns_status cs_txt(vbuf *vb, const void *datap)
static adns_status csp_hostaddr(vbuf *vb, const adns_rr_hostaddr *rrp)
static int di_mx(adns_state ads, const void *datap_a, const void *datap_b)
static adns_status cs_hostaddr(vbuf *vb, const void *datap)
static adns_status cs_rp(vbuf *vb, const void *datap)
static void icb_ptr(adns_query parent, adns_query child)
static void mf_inthostaddr(adns_query qu, void *datap)
static adns_status csp_mailbox(vbuf *vb, const char *mailbox)
static void mf_intstr(adns_query qu, void *datap)
static void mf_intstrpair(adns_query qu, void *datap)
static adns_status pa_addr(const parseinfo *pai, int cbyte, int max, void *datap)
static void mf_str(adns_query qu, void *datap)
static int di_hostaddr(adns_state ads, const void *datap_a, const void *datap_b)
static adns_status pa_dom_raw(const parseinfo *pai, int cbyte, int max, void *datap)
#define DEEP_TYPE(code, rrt, fmt, memb, parser, comparer, printer)
static adns_status cs_hinfo(vbuf *vb, const void *datap)
static void mf_hostaddr(adns_query qu, void *datap)
static int di_addr(adns_state ads, const void *datap_a, const void *datap_b)
static adns_status cs_inthostaddr(vbuf *vb, const void *datap)
static adns_status pa_soa(const parseinfo *pai, int cbyte, int max, void *datap)
static adns_status pa_inaddr(const parseinfo *pai, int cbyte, int max, void *datap)
static adns_status cs_soa(vbuf *vb, const void *datap)
static void mfp_hostaddr(adns_query qu, adns_rr_hostaddr *rrp)
const char * errstr(int errcode)
void int int ULONGLONG int va_list * ap