30 #ifndef ADNS_INTERNAL_H_INCLUDED 31 #define ADNS_INTERNAL_H_INCLUDED 35 #ifndef ADNS_JGAA_WIN32 36 typedef unsigned char byte;
43 #ifndef ADNS_JGAA_WIN32 50 #ifndef ADNS_JGAA_WIN32 57 #ifdef ADNS_REGRESS_TEST 58 # include "hredirect.h" 64 #define MAXSORTLIST 15 65 #define UDPMAXRETRIES 15 66 #define UDPRETRYMS 2000 67 #define TCPWAITMS 30000 68 #define TCPCONNMS 14000 69 #define TCPIDLEMS 30000 70 #define MAXTTLBELIEVE (7*86400) 73 #define DNS_MAXUDP 512 74 #define DNS_MAXLABEL 63 75 #define DNS_MAXDOMAIN 255 76 #define DNS_HDRSIZE 12 77 #define DNS_IDOFFSET 0 78 #define DNS_CLASS_IN 1 80 #define DNS_INADDR_ARPA "in-addr", "arpa" 82 #define MAX_POLLFDS ADNS_POLLFDS_RECOMMENDED 311 #ifndef ADNS_JGAA_WIN32 383 const char *owner,
int ol,
389 const byte *qd_dgram,
int qd_dglen,
int qd_begin,
543 const byte *dgram,
int dglen,
int max,
544 int dmbegin,
int *dmend_rlater);
583 const byte *dgram,
int dglen,
int *cbyte_io,
int max);
602 const byte *dgram,
int dglen,
int *cbyte_io,
603 int *type_r,
int *class_r,
unsigned long *ttl_r,
604 int *rdlen_r,
int *rdstart_r,
605 int *ownermatchedquery_r);
631 const byte *dgram,
int dglen,
int *cbyte_io,
632 int *type_r,
int *class_r,
unsigned long *ttl_r,
633 int *rdlen_r,
int *rdstart_r,
634 const byte *eo_dgram,
int eo_dglen,
int eo_cbyte,
675 const struct pollfd *pollfds,
int npollfds,
676 int maxfd,
const fd_set *readfds,
700 return (
c >=
'a' &&
c <=
'z') || (
c >=
'A' &&
c <=
'Z');
711 #define MEM_ROUND(sz) \ 712 (( ((sz)+sizeof(union maxalign)-1) / sizeof(union maxalign) ) \ 713 * sizeof(union maxalign) ) 715 #define GETIL_B(cb) (((dgram)[(cb)++]) & 0x0ff) 716 #define GET_B(cb,tv) ((tv)= GETIL_B((cb))) 717 #define GET_W(cb,tv) ((tv)=0, (tv)|=(GETIL_B((cb))<<8), (tv)|=GETIL_B(cb), (tv)) 718 #define GET_L(cb,tv) ( (tv)=0, \ 719 (tv)|=(GETIL_B((cb))<<24), \ 720 (tv)|=(GETIL_B((cb))<<16), \ 721 (tv)|=(GETIL_B((cb))<<8), \ static unsigned int block
void adns__search_next(adns_state ads, adns_query qu, struct timeval now)
adns_status adns__findrr(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, int *ownermatchedquery_r)
void adns__sigpipe_unprotect(adns_state)
void void adns__warn(adns_state ads, int serv, adns_query qu, const char *fmt,...) PRINTFFORMAT(4
adns_rr_addr ptr_parent_addr
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)
void void void adns__diag(adns_state ads, int serv, adns_query qu, const char *fmt,...) PRINTFFORMAT(4
struct adns__query::@3985 children
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__fdevents(adns_state ads, const struct pollfd *pollfds, int npollfds, int maxfd, const fd_set *readfds, const fd_set *writefds, const fd_set *exceptfds, struct timeval now, int *r_r)
void adns__update_expires(adns_query qu, unsigned long ttl, struct timeval now)
void adns__vbuf_free(vbuf *vb)
void adns__querysend_tcp(adns_query qu, struct timeval now)
int adns__pollfds(adns_state ads, struct pollfd pollfds_buf[MAX_POLLFDS])
struct __SEHPortableFrame *typedef void(__stdcall *_SEHHandler_t)(struct __SEHPortableTryLevel *)
static int errno_resources(int e)
void * adns__alloc_interim(adns_query qu, size_t sz)
adns_status adns__findlabel_next(findlabel_state *fls, int *lablen_r, int *labstart_r)
void adns__query_done(adns_query qu)
GLenum GLuint GLenum GLsizei const GLchar * buf
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__transfer_interim(adns_query from, adns_query to, void *block, size_t sz)
int adns__vbuf_append(vbuf *vb, const byte *data, int len)
void void void int adns__vbuf_ensure(vbuf *vb, int want)
struct adns__query::@3986 siblings
void adns__reset_preserved(adns_query qu)
static struct _test_info info[]
int vbuf__append_quoted1035(vbuf *vb, const byte *buf, int len)
void * adns__alloc_preserved(adns_query qu, size_t sz)
static int ctype_domainunquoted(int c)
struct adns__query::@3987 allocations
void adns__tcp_broken(adns_state ads, const char *what, const char *why)
void adns__tcp_tryconnect(adns_state ads, struct timeval now)
void adns__isort(void *array, int nobjs, int sz, void *tempbuf, int(*needswap)(void *context, const void *a, const void *b), void *context)
void adns__sigpipe_protect(adns_state)
adns_status adns__parse_domain_more(findlabel_state *fls, adns_state ads, adns_query qu, vbuf *vb, parsedomain_flags flags, const byte *dgram)
const typeinfo * adns__findtype(adns_rrtype type)
typedef int(__cdecl *_SEHFrameHandler_t)(struct _EXCEPTION_RECORD *
GLboolean GLboolean GLboolean b
struct adns__state::server servers[MAXSERVERS]
int adns__vbuf_appendstr(vbuf *vb, const char *data)
struct timeval tcptimeout
adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r, const char *owner, int ol, const typeinfo *typei, adns_queryflags flags)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum const GLvoid * addr
void * adns__alloc_final(adns_query qu, size_t sz)
static ITypeInfo * typeinfo[last_tid]
struct sigaction stdsigpipe
static int ctype_digit(int c)
void adns__consistency(adns_state ads, adns_query qu, consistency_checks cc)
void adns__debug(adns_state ads, int serv, adns_query qu, const char *fmt,...) PRINTFFORMAT(4
void adns__makefinal_block(adns_query qu, void **blpp, size_t sz)
void adns__autosys(adns_state ads, struct timeval now)
void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io, struct timeval *tv_buf)
void adns__vbuf_appendq(vbuf *vb, const byte *data, int len)
static int ctype_whitespace(int c)
static int ctype_822special(int c)
void adns__vbuf_init(vbuf *vb)
struct allocnode allocnode
adns_rr_hostaddr * hostaddr
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)
char * strchr(const char *String, int ch)
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)
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)
void adns__query_send(adns_query qu, struct timeval now)
struct query_queue udpw tcpw childw output
void adns__query_fail(adns_query qu, adns_status stat)
const char * adns__diag_domain(adns_state ads, int serv, adns_query qu, vbuf *vb, const byte *dgram, int dglen, int cbyte)
static int ctype_alpha(int c)
GLuint GLuint GLsizei GLenum type
int adns__setnonblock(adns_state ads, ADNS_SOCKET fd)
static IPrintDialogCallback callback
GLboolean GLboolean GLboolean GLboolean a
void * adns__alloc_mine(adns_query qu, size_t sz)
void adns__makefinal_str(adns_query qu, char **strp)
void adns__procdgram(adns_state ads, const byte *dgram, int len, int serv, int viatcp, struct timeval now)
int adns__internal_check(adns_state ads, adns_query *query_io, adns_answer **answer, void **context_r)
struct pollfd pollfds_buf[MAX_POLLFDS]
#define PRINTFFORMAT(si, tc)
enum adns__state::adns__tcpstate tcpstate
void adns__timeouts(adns_state ads, int act, struct timeval **tv_io, struct timeval *tvbuf, struct timeval now)
enum adns__query::@3984 state