Lines Matching refs:doh

31 #include "doh.h"
186 static int doh_done(struct Curl_easy *doh, CURLcode result)
188 struct Curl_easy *data = doh->set.dohfor;
189 struct dohdata *dohp = data->req.doh;
207 result = curl_easy_setopt(doh, x, y); \
220 struct Curl_easy *doh = NULL;
239 result = Curl_open(&doh);
244 doh->state.internal = true;
284 options should be added to check doh proxy insecure separately,
335 (void)curl_easy_setopt(doh, CURLOPT_SSL_OPTIONS, mask);
338 doh->set.fmultidone = doh_done;
339 doh->set.dohfor = data; /* identify for which transfer this is done */
340 p->easy = doh;
346 DEBUGASSERT(!doh->set.private_data);
348 if(curl_multi_add_handle(multi, doh))
356 Curl_close(&doh);
378 DEBUGASSERT(!data->req.doh);
382 dohp = data->req.doh = calloc(1, sizeof(struct dohdata));
386 conn->bits.doh = TRUE;
419 data->req.doh->headers = NULL;
424 Curl_safefree(data->req.doh);
428 static DOHcode skipqname(const unsigned char *doh, size_t dohlen,
435 length = doh[*indexp];
452 static unsigned short get16bit(const unsigned char *doh, int index)
454 return (unsigned short)((doh[index] << 8) | doh[index + 1]);
457 static unsigned int get32bit(const unsigned char *doh, int index)
461 doh += index;
466 return ((unsigned)doh[0] << 24) | ((unsigned)doh[1] << 16) |
467 ((unsigned)doh[2] << 8) | doh[3];
470 static DOHcode store_a(const unsigned char *doh, int index, struct dohentry *d)
476 memcpy(&a->ip.v4, &doh[index], 4);
482 static DOHcode store_aaaa(const unsigned char *doh,
490 memcpy(&a->ip.v6, &doh[index], 16);
496 static DOHcode store_cname(const unsigned char *doh,
512 length = doh[index];
520 newpos = (length & 0x3f) << 8 | doh[index + 1];
537 if(Curl_dyn_addn(c, &doh[index], length))
548 static DOHcode rdata(const unsigned char *doh,
565 rc = store_a(doh, index, d);
572 rc = store_aaaa(doh, index, d);
577 rc = store_cname(doh, dohlen, index, d);
601 UNITTEST DOHcode doh_decode(const unsigned char *doh,
618 if(!doh || doh[0] || doh[1])
620 rcode = doh[3] & 0x0f;
624 qdcount = get16bit(doh, 4);
626 rc = skipqname(doh, dohlen, &index);
635 ancount = get16bit(doh, 6);
640 rc = skipqname(doh, dohlen, &index);
647 type = get16bit(doh, index);
657 class = get16bit(doh, index);
665 ttl = get32bit(doh, index);
673 rdlength = get16bit(doh, index);
678 rc = rdata(doh, dohlen, rdlength, type, index, d);
685 nscount = get16bit(doh, 8);
687 rc = skipqname(doh, dohlen, &index);
699 rdlength = get16bit(doh, index);
707 arcount = get16bit(doh, 10);
709 rc = skipqname(doh, dohlen, &index);
721 rdlength = get16bit(doh, index);
906 struct dohdata *dohp = data->req.doh;
986 Curl_safefree(data->req.doh);