Lines Matching refs:doh
190 static int doh_done(struct Curl_easy *doh, CURLcode result) in doh_done() argument
192 struct Curl_easy *data = doh->set.dohfor; in doh_done()
193 struct dohdata *dohp = data->req.doh; in doh_done()
211 result = curl_easy_setopt(doh, x, y); \
224 struct Curl_easy *doh = NULL; in dohprobe() local
263 result = Curl_open(&doh); in dohprobe()
362 (void)curl_easy_setopt(doh, CURLOPT_SSL_OPTIONS, mask); in dohprobe()
365 doh->set.fmultidone = doh_done; in dohprobe()
366 doh->set.dohfor = data; /* identify for which transfer this is done */ in dohprobe()
367 p->easy = doh; in dohprobe()
372 DEBUGASSERT(!doh->set.private_data); in dohprobe()
374 if(curl_multi_add_handle(multi, doh)) in dohprobe()
384 Curl_close(&doh); in dohprobe()
406 DEBUGASSERT(!data->req.doh); in Curl_doh()
410 dohp = data->req.doh = calloc(sizeof(struct dohdata), 1); in Curl_doh()
414 conn->bits.doh = TRUE; in Curl_doh()
444 data->req.doh->headers = NULL; in Curl_doh()
448 Curl_safefree(data->req.doh); in Curl_doh()
452 static DOHcode skipqname(const unsigned char *doh, size_t dohlen, in skipqname() argument
459 length = doh[*indexp]; in skipqname()
476 static unsigned short get16bit(const unsigned char *doh, int index) in get16bit() argument
478 return (unsigned short)((doh[index] << 8) | doh[index + 1]); in get16bit()
481 static unsigned int get32bit(const unsigned char *doh, int index) in get32bit() argument
485 doh += index; in get32bit()
490 return ( (unsigned)doh[0] << 24) | (doh[1] << 16) |(doh[2] << 8) | doh[3]; in get32bit()
493 static DOHcode store_a(const unsigned char *doh, int index, struct dohentry *d) in store_a() argument
499 memcpy(&a->ip.v4, &doh[index], 4); in store_a()
505 static DOHcode store_aaaa(const unsigned char *doh, in store_aaaa() argument
513 memcpy(&a->ip.v6, &doh[index], 16); in store_aaaa()
519 static DOHcode store_cname(const unsigned char *doh, in store_cname() argument
535 length = doh[index]; in store_cname()
543 newpos = (length & 0x3f) << 8 | doh[index + 1]; in store_cname()
560 if(Curl_dyn_addn(c, &doh[index], length)) in store_cname()
571 static DOHcode rdata(const unsigned char *doh, in rdata() argument
588 rc = store_a(doh, index, d); in rdata()
595 rc = store_aaaa(doh, index, d); in rdata()
600 rc = store_cname(doh, dohlen, index, d); in rdata()
624 UNITTEST DOHcode doh_decode(const unsigned char *doh, in doh_decode() argument
641 if(!doh || doh[0] || doh[1]) in doh_decode()
643 rcode = doh[3] & 0x0f; in doh_decode()
647 qdcount = get16bit(doh, 4); in doh_decode()
649 rc = skipqname(doh, dohlen, &index); in doh_decode()
658 ancount = get16bit(doh, 6); in doh_decode()
663 rc = skipqname(doh, dohlen, &index); in doh_decode()
670 type = get16bit(doh, index); in doh_decode()
680 class = get16bit(doh, index); in doh_decode()
688 ttl = get32bit(doh, index); in doh_decode()
696 rdlength = get16bit(doh, index); in doh_decode()
701 rc = rdata(doh, dohlen, rdlength, type, index, d); in doh_decode()
708 nscount = get16bit(doh, 8); in doh_decode()
710 rc = skipqname(doh, dohlen, &index); in doh_decode()
722 rdlength = get16bit(doh, index); in doh_decode()
730 arcount = get16bit(doh, 10); in doh_decode()
732 rc = skipqname(doh, dohlen, &index); in doh_decode()
744 rdlength = get16bit(doh, index); in doh_decode()
927 struct dohdata *dohp = data->req.doh; in Curl_doh_is_resolved()
1005 Curl_safefree(data->req.doh); in Curl_doh_is_resolved()