41#define MKQUERY_START(vb) (rqp= (vb)->buf+(vb)->used)
42#define MKQUERY_ADDB(b) *rqp++= (b)
43#define MKQUERY_ADDW(w) (MKQUERY_ADDB(((w)>>8)&0x0ff), MKQUERY_ADDB((w)&0x0ff))
44#define MKQUERY_STOP(vb) ((vb)->used= rqp-(vb)->buf)
82 const char *owner,
int ol,
85 byte label[255], *rqp;
93 p= owner; pe= owner+ol;
97 while (
p!=pe && (
c= *
p++)!=
'.') {
102 c= (
p[0] -
'0')*100 + (
p[1] -
'0')*10 + (
p[2] -
'0');
108 }
else if (!(
c= *
p++)) {
139 const byte *qd_dgram,
int qd_dglen,
int qd_begin,
143 int lablen, labstart;
156 memcpy(rqp,qd_dgram+labstart, (
size_t) lablen);
218 if (wr<qu->query_dglen) {
224 qu->
state= query_tcpw;
249 memset(&servaddr,0,
sizeof(servaddr));
258 (
const struct sockaddr*)&servaddr,
sizeof(servaddr));
@ adns_s_querydomaintoolong
@ adns_s_querydomaininvalid
#define writev(FileDescriptor, iov, iovCount)
#define ADNS_CAPTURE_ERRNO
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLuint GLsizei GLsizei * length
#define memcpy(s1, s2, n)
static const WCHAR label[]
const char * strerror(int err)
#define LIST_LINK_TAIL(list, node)
void adns__tcp_broken(adns_state ads, const char *what, const char *why)
void adns__tcp_tryconnect(adns_state ads, struct timeval now)
int adns__vbuf_append(vbuf *vb, const byte *data, int len)
void adns__sigpipe_protect(adns_state ads)
void adns__sigpipe_unprotect(adns_state ads)
void adns__warn(adns_state ads, int serv, adns_query qu, const char *fmt,...)
int adns__vbuf_ensure(vbuf *vb, int want)
static int ctype_alpha(int c)
void adns__query_fail(adns_query qu, adns_status stat)
static int ctype_digit(int c)
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)
static void query_usetcp(adns_query qu, struct timeval now)
#define MKQUERY_START(vb)
adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r, const char *owner, int ol, const typeinfo *typei, adns_queryflags flags)
void adns__querysend_tcp(adns_query qu, struct timeval now)
static adns_status mkquery_footer(vbuf *vb, adns_rrtype type)
static adns_status mkquery_header(adns_state ads, vbuf *vb, int *id_r, int qdlen)
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__query_send(adns_query qu, struct timeval now)
enum adns__query::@4228 state
enum adns__state::adns__tcpstate tcpstate
struct timeval tcptimeout
struct adns__state::server servers[MAXSERVERS]
static void timevaladd(struct timeval *tv_io, long ms)