Lines Matching defs:index

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;
470 static DOHcode store_a(const unsigned char *doh, int index, struct dohentry *d)
476 memcpy(&a->ip.v4, &doh[index], 4);
483 int index,
490 memcpy(&a->ip.v6, &doh[index], 16);
498 unsigned int index,
510 if(index >= dohlen)
512 length = doh[index];
516 if((index + 1) >= dohlen)
519 /* move to the new index */
520 newpos = (length & 0x3f) << 8 | doh[index + 1];
521 index = newpos;
527 index++;
534 if((index + length) > dohlen)
537 if(Curl_dyn_addn(c, &doh[index], length))
539 index += length;
552 int index,
565 rc = store_a(doh, index, d);
572 rc = store_aaaa(doh, index, d);
577 rc = store_cname(doh, dohlen, index, d);
613 unsigned int index = 12;
626 rc = skipqname(doh, dohlen, &index);
629 if(dohlen < (index + 4))
631 index += 4; /* skip question's type and class */
640 rc = skipqname(doh, dohlen, &index);
644 if(dohlen < (index + 2))
647 type = get16bit(doh, index);
653 index += 2;
655 if(dohlen < (index + 2))
657 class = get16bit(doh, index);
660 index += 2;
662 if(dohlen < (index + 4))
665 ttl = get32bit(doh, index);
668 index += 4;
670 if(dohlen < (index + 2))
673 rdlength = get16bit(doh, index);
674 index += 2;
675 if(dohlen < (index + rdlength))
678 rc = rdata(doh, dohlen, rdlength, type, index, d);
681 index += rdlength;
687 rc = skipqname(doh, dohlen, &index);
691 if(dohlen < (index + 8))
694 index += 2 + 2 + 4; /* type, class and ttl */
696 if(dohlen < (index + 2))
699 rdlength = get16bit(doh, index);
700 index += 2;
701 if(dohlen < (index + rdlength))
703 index += rdlength;
709 rc = skipqname(doh, dohlen, &index);
713 if(dohlen < (index + 8))
716 index += 2 + 2 + 4; /* type, class and ttl */
718 if(dohlen < (index + 2))
721 rdlength = get16bit(doh, index);
722 index += 2;
723 if(dohlen < (index + rdlength))
725 index += rdlength;
729 if(index != dohlen)