Lines Matching refs:index

527                                    unsigned int index)  in doh_get16bit()  argument
529 return (unsigned short)((doh[index] << 8) | doh[index + 1]); in doh_get16bit()
532 static unsigned int doh_get32bit(const unsigned char *doh, unsigned int index) in doh_get32bit() argument
536 doh += index; in doh_get32bit()
545 static void doh_store_a(const unsigned char *doh, int index, in doh_store_a() argument
552 memcpy(&a->ip.v4, &doh[index], 4); in doh_store_a()
557 static void doh_store_aaaa(const unsigned char *doh, int index, in doh_store_aaaa() argument
564 memcpy(&a->ip.v6, &doh[index], 16); in doh_store_aaaa()
570 static DOHcode doh_store_https(const unsigned char *doh, int index, in doh_store_https() argument
576 h->val = Curl_memdup(&doh[index], len); in doh_store_https()
587 unsigned int index, struct dohentry *d) in doh_store_cname() argument
598 if(index >= dohlen) in doh_store_cname()
600 length = doh[index]; in doh_store_cname()
604 if((index + 1) >= dohlen) in doh_store_cname()
608 newpos = (length & 0x3f) << 8 | doh[index + 1]; in doh_store_cname()
609 index = (unsigned int)newpos; in doh_store_cname()
615 index++; in doh_store_cname()
622 if((index + length) > dohlen) in doh_store_cname()
625 if(Curl_dyn_addn(c, &doh[index], length)) in doh_store_cname()
627 index += length; in doh_store_cname()
640 int index, in doh_rdata() argument
654 doh_store_a(doh, index, d); in doh_rdata()
659 doh_store_aaaa(doh, index, d); in doh_rdata()
663 rc = doh_store_https(doh, index, d, rdlength); in doh_rdata()
669 rc = doh_store_cname(doh, dohlen, (unsigned int)index, d); in doh_rdata()
705 unsigned int index = 12; in doh_resp_decode() local
718 rc = doh_skipqname(doh, dohlen, &index); in doh_resp_decode()
721 if(dohlen < (index + 4)) in doh_resp_decode()
723 index += 4; /* skip question's type and class */ in doh_resp_decode()
732 rc = doh_skipqname(doh, dohlen, &index); in doh_resp_decode()
736 if(dohlen < (index + 2)) in doh_resp_decode()
739 type = doh_get16bit(doh, index); in doh_resp_decode()
745 index += 2; in doh_resp_decode()
747 if(dohlen < (index + 2)) in doh_resp_decode()
749 class = doh_get16bit(doh, index); in doh_resp_decode()
752 index += 2; in doh_resp_decode()
754 if(dohlen < (index + 4)) in doh_resp_decode()
757 ttl = doh_get32bit(doh, index); in doh_resp_decode()
760 index += 4; in doh_resp_decode()
762 if(dohlen < (index + 2)) in doh_resp_decode()
765 rdlength = doh_get16bit(doh, index); in doh_resp_decode()
766 index += 2; in doh_resp_decode()
767 if(dohlen < (index + rdlength)) in doh_resp_decode()
770 rc = doh_rdata(doh, dohlen, rdlength, type, (int)index, d); in doh_resp_decode()
773 index += rdlength; in doh_resp_decode()
779 rc = doh_skipqname(doh, dohlen, &index); in doh_resp_decode()
783 if(dohlen < (index + 8)) in doh_resp_decode()
786 index += 2 + 2 + 4; /* type, class and ttl */ in doh_resp_decode()
788 if(dohlen < (index + 2)) in doh_resp_decode()
791 rdlength = doh_get16bit(doh, index); in doh_resp_decode()
792 index += 2; in doh_resp_decode()
793 if(dohlen < (index + rdlength)) in doh_resp_decode()
795 index += rdlength; in doh_resp_decode()
801 rc = doh_skipqname(doh, dohlen, &index); in doh_resp_decode()
805 if(dohlen < (index + 8)) in doh_resp_decode()
808 index += 2 + 2 + 4; /* type, class and ttl */ in doh_resp_decode()
810 if(dohlen < (index + 2)) in doh_resp_decode()
813 rdlength = doh_get16bit(doh, index); in doh_resp_decode()
814 index += 2; in doh_resp_decode()
815 if(dohlen < (index + rdlength)) in doh_resp_decode()
817 index += rdlength; in doh_resp_decode()
821 if(index != dohlen) in doh_resp_decode()