Lines Matching refs:mDNSu8
198 const mDNSu8 *t = rd->txt.c; in GetRRDisplayString_rdb()
230 …length += mDNS_snprintf(buffer+length, RemSpc, " Seq %3d", (mDNSu8)opt->u.owner.seq); // Display a… in GetRRDisplayString_rdb()
272 mDNSlocal mDNSu32 mDNSMixRandomSeed(mDNSu32 seed, mDNSu8 iteration) in mDNSMixRandomSeed()
333 mDNSexport mDNSBool SameDomainLabel(const mDNSu8 *a, const mDNSu8 *b) in SameDomainLabel()
344 mDNSu8 ac = *a++; in SameDomainLabel()
345 mDNSu8 bc = *b++; in SameDomainLabel()
355 const mDNSu8 * a = d1->c; in SameDomainName()
356 const mDNSu8 * b = d2->c; in SameDomainName()
357 const mDNSu8 *const max = d1->c + MAX_DOMAIN_NAME; // Maximum that's valid in SameDomainName()
406 mDNSexport const mDNSu8 *LastLabel(const domainname *d) in LastLabel()
408 const mDNSu8 *p = d->c; in LastLabel()
422 mDNSexport mDNSu16 DomainNameLengthLimit(const domainname *const name, const mDNSu8 *limit) in DomainNameLengthLimit()
424 const mDNSu8 *src = name->c; in DomainNameLengthLimit()
444 const mDNSu8 *src = name->c; in CompressedDomainNameLength()
461 const mDNSu8 *ptr; in CountLabels()
481 mDNSexport mDNSu8 *AppendLiteralLabelString(domainname *const name, const char *cstr) in AppendLiteralLabelString()
483 mDNSu8 * ptr = name->c + DomainNameLength(name) - 1; // Find end of current name in AppendLiteralLabelString()
484 …const mDNSu8 *const lim1 = name->c + MAX_DOMAIN_NAME - 1; // Limit of how much we can add (not c… in AppendLiteralLabelString()
485 const mDNSu8 *const lim2 = ptr + 1 + MAX_DOMAIN_LABEL; in AppendLiteralLabelString()
486 const mDNSu8 *const lim = (lim1 < lim2) ? lim1 : lim2; in AppendLiteralLabelString()
487 mDNSu8 *lengthbyte = ptr++; // Record where the length is going to go in AppendLiteralLabelString()
489 while (*cstr && ptr < lim) *ptr++ = (mDNSu8)*cstr++; // Copy the data in AppendLiteralLabelString()
490 *lengthbyte = (mDNSu8)(ptr - lengthbyte - 1); // Fill in the length byte in AppendLiteralLabelString()
503 mDNSexport mDNSu8 *AppendDNSNameString(domainname *const name, const char *cstring) in AppendDNSNameString()
506 mDNSu8 * ptr = name->c + DomainNameLength(name) - 1; // Find end of current name in AppendDNSNameString()
507 …const mDNSu8 *const lim = name->c + MAX_DOMAIN_NAME - 1; // Limit of how much we can add (not cou… in AppendDNSNameString()
510 mDNSu8 *lengthbyte = ptr++; // Record where the length is going to go in AppendDNSNameString()
514 mDNSu8 c = (mDNSu8)*cstr++; // Read the character in AppendDNSNameString()
517 c = (mDNSu8)*cstr++; // Assume we'll just take the next character in AppendDNSNameString()
524 if (val <= 255) { c = (mDNSu8)val; cstr += 2; } // If valid three-digit decimal value, use it in AppendDNSNameString()
532 *lengthbyte = (mDNSu8)(ptr - lengthbyte - 1); // Fill in the length byte in AppendDNSNameString()
545 mDNSexport mDNSu8 *AppendDomainLabel(domainname *const name, const domainlabel *const label) in AppendDomainLabel()
548 mDNSu8 *ptr = name->c + DomainNameLength(name) - 1; in AppendDomainLabel()
561 mDNSexport mDNSu8 *AppendDomainName(domainname *const name, const domainname *const append) in AppendDomainName()
563 mDNSu8 * ptr = name->c + DomainNameLength(name) - 1; // Find end of current name in AppendDomainName()
564 …const mDNSu8 *const lim = name->c + MAX_DOMAIN_NAME - 1; // Limit of how much we can add (not cou… in AppendDomainName()
565 const mDNSu8 * src = append->c; in AppendDomainName()
585 mDNSu8 * ptr = label->c + 1; // Where we're putting it in MakeDomainLabelFromLiteralString()
586 const mDNSu8 *const limit = label->c + 1 + MAX_DOMAIN_LABEL; // The maximum we can put in MakeDomainLabelFromLiteralString()
587 while (*cstr && ptr < limit) *ptr++ = (mDNSu8)*cstr++; // Copy the label in MakeDomainLabelFromLiteralString()
588 label->c[0] = (mDNSu8)(ptr - label->c - 1); // Set the length byte in MakeDomainLabelFromLiteralString()
599 mDNSexport mDNSu8 *MakeDomainNameFromDNSNameString(domainname *const name, const char *cstr) in MakeDomainNameFromDNSNameString()
607 const mDNSu8 * src = label->c; // Domain label we're reading in ConvertDomainLabelToCString_withescape()
608 const mDNSu8 len = *src++; // Read length of this (non-null) label in ConvertDomainLabelToCString_withescape()
609 const mDNSu8 *const end = src + len; // Work out where the label ends in ConvertDomainLabelToCString_withescape()
613 mDNSu8 c = *src++; in ConvertDomainLabelToCString_withescape()
623 c = (mDNSu8)('0' + (c ) % 10); in ConvertDomainLabelToCString_withescape()
635 const mDNSu8 *src = name->c; // Domain name we're reading in ConvertDomainNameToCString_withescape()
636 const mDNSu8 *const max = name->c + MAX_DOMAIN_NAME; // Maximum that's valid in ConvertDomainNameToCString_withescape()
658 mDNSexport void ConvertUTF8PstringToRFC1034HostLabel(const mDNSu8 UTF8Name[], domainlabel *const ho… in ConvertUTF8PstringToRFC1034HostLabel()
660 const mDNSu8 * src = &UTF8Name[1]; in ConvertUTF8PstringToRFC1034HostLabel()
661 const mDNSu8 *const end = &UTF8Name[1] + UTF8Name[0]; in ConvertUTF8PstringToRFC1034HostLabel()
662 mDNSu8 * ptr = &hostlabel->c[1]; in ConvertUTF8PstringToRFC1034HostLabel()
663 const mDNSu8 *const lim = &hostlabel->c[1] + MAX_DOMAIN_LABEL; in ConvertUTF8PstringToRFC1034HostLabel()
678 hostlabel->c[0] = (mDNSu8)(ptr - &hostlabel->c[1]); in ConvertUTF8PstringToRFC1034HostLabel()
685 mDNSexport mDNSu8 *ConstructServiceName(domainname *const fqdn, in ConstructServiceName()
689 mDNSu8 *dst = fqdn->c; in ConstructServiceName()
690 const mDNSu8 *src; in ConstructServiceName()
701 const mDNSu8 *s0 = type->c; in ConstructServiceName()
704 const mDNSu8 * s1 = s0 + 1 + s0[0]; in ConstructServiceName()
707 const mDNSu8 *s2 = s1 + 1 + s1[0]; in ConstructServiceName()
710 static const mDNSu8 SubTypeLabel[5] = "\x04_sub"; in ConstructServiceName()
808 const mDNSu8 *src = fqdn->c; in DeconstructServiceName()
809 const mDNSu8 *max = fqdn->c + MAX_DOMAIN_NAME; in DeconstructServiceName()
810 mDNSu8 *dst; in DeconstructServiceName()
862 mDNSexport mDNSu32 TruncateUTF8ToLength(mDNSu8 *string, mDNSu32 length, mDNSu32 max) in TruncateUTF8ToLength()
866 mDNSu8 c1 = string[max]; // First byte after cut point in TruncateUTF8ToLength()
867 mDNSu8 c2 = (max+1 < length) ? string[max+1] : (mDNSu8)0xB0; // Second byte after cut point in TruncateUTF8ToLength()
950 name->c[0] = (mDNSu8) TruncateUTF8ToLength(name->c+1, name->c[0], MAX_DOMAIN_LABEL - chars); in AppendLabelSuffix()
957 name->c[++name->c[0]] = (mDNSu8)('0' + val / divisor); in AppendLabelSuffix()
992 …mDNSu16 rrtype, mDNSu32 ttl, mDNSu8 RecordType, AuthRecType artype, mDNSRecordCallback Callback, v… in mDNS_SetupResourceRecord()
1483 const mDNSu8 *ptr = rd->u.txt.c; in ValidateRData()
1484 const mDNSu8 *end = rd->u.txt.c + rdlength; in ValidateRData()
1523 mDNSexport const mDNSu8 *FindCompressionPointer(const mDNSu8 *const base, const mDNSu8 *const end, … in FindCompressionPointer()
1525 const mDNSu8 *result = end - *domname - 1; in FindCompressionPointer()
1536 const mDNSu8 *name = domname; in FindCompressionPointer()
1537 const mDNSu8 *targ = result; in FindCompressionPointer()
1542 const mDNSu8 *pointertarget; in FindCompressionPointer()
1572 mDNSexport mDNSu8 *putDomainNameAsLabels(const DNSMessage *const msg, in putDomainNameAsLabels()
1573 mDNSu8 *ptr, const mDNSu8 *const limit, const domainname *const name) in putDomainNameAsLabels()
1575 const mDNSu8 *const base = (const mDNSu8 *)msg; in putDomainNameAsLabels()
1576 const mDNSu8 * np = name->c; in putDomainNameAsLabels()
1577 const mDNSu8 *const max = name->c + MAX_DOMAIN_NAME; // Maximum that's valid in putDomainNameAsLabels()
1578 const mDNSu8 * pointer = mDNSNULL; in putDomainNameAsLabels()
1579 const mDNSu8 *const searchlimit = ptr; in putDomainNameAsLabels()
1610 *ptr++ = (mDNSu8)(0xC0 | (offset >> 8)); in putDomainNameAsLabels()
1611 *ptr++ = (mDNSu8)( offset & 0xFF); in putDomainNameAsLabels()
1617 mDNSu8 len = *np++; in putDomainNameAsLabels()
1630 mDNSlocal mDNSu8 *putVal16(mDNSu8 *ptr, mDNSu16 val) in putVal16()
1632 ptr[0] = (mDNSu8)((val >> 8 ) & 0xFF); in putVal16()
1633 ptr[1] = (mDNSu8)((val ) & 0xFF); in putVal16()
1637 mDNSlocal mDNSu8 *putVal32(mDNSu8 *ptr, mDNSu32 val) in putVal32()
1639 ptr[0] = (mDNSu8)((val >> 24) & 0xFF); in putVal32()
1640 ptr[1] = (mDNSu8)((val >> 16) & 0xFF); in putVal32()
1641 ptr[2] = (mDNSu8)((val >> 8) & 0xFF); in putVal32()
1642 ptr[3] = (mDNSu8)((val ) & 0xFF); in putVal32()
1647 mDNSexport mDNSu8 *putRData(const DNSMessage *const msg, mDNSu8 *ptr, const mDNSu8 *const limit, co… in putRData()
1714 *ptr++ = (mDNSu8)(rdb->srv.priority >> 8); in putRData()
1715 *ptr++ = (mDNSu8)(rdb->srv.priority & 0xFF); in putRData()
1716 *ptr++ = (mDNSu8)(rdb->srv.weight >> 8); in putRData()
1717 *ptr++ = (mDNSu8)(rdb->srv.weight & 0xFF); in putRData()
1782 *ptr++ = (mDNSu8)i; in putRData()
1797 …NSexport mDNSu8 *PutResourceRecordTTLWithLimit(DNSMessage *const msg, mDNSu8 *ptr, mDNSu16 *count,… in PutResourceRecordTTLWithLimit()
1799 mDNSu8 *endofrdata; in PutResourceRecordTTLWithLimit()
1814 ptr[0] = (mDNSu8)(rr->rrtype >> 8); in PutResourceRecordTTLWithLimit()
1815 ptr[1] = (mDNSu8)(rr->rrtype & 0xFF); in PutResourceRecordTTLWithLimit()
1816 ptr[2] = (mDNSu8)(rr->rrclass >> 8); in PutResourceRecordTTLWithLimit()
1817 ptr[3] = (mDNSu8)(rr->rrclass & 0xFF); in PutResourceRecordTTLWithLimit()
1818 ptr[4] = (mDNSu8)((ttl >> 24) & 0xFF); in PutResourceRecordTTLWithLimit()
1819 ptr[5] = (mDNSu8)((ttl >> 16) & 0xFF); in PutResourceRecordTTLWithLimit()
1820 ptr[6] = (mDNSu8)((ttl >> 8) & 0xFF); in PutResourceRecordTTLWithLimit()
1821 ptr[7] = (mDNSu8)( ttl & 0xFF); in PutResourceRecordTTLWithLimit()
1830 ptr[8] = (mDNSu8)(actualLength >> 8); in PutResourceRecordTTLWithLimit()
1831 ptr[9] = (mDNSu8)(actualLength & 0xFF); in PutResourceRecordTTLWithLimit()
1838 mDNSlocal mDNSu8 *putEmptyResourceRecord(DNSMessage *const msg, mDNSu8 *ptr, const mDNSu8 *const li… in putEmptyResourceRecord()
1842 ptr[0] = (mDNSu8)(rr->resrec.rrtype >> 8); // Put type in putEmptyResourceRecord()
1843 ptr[1] = (mDNSu8)(rr->resrec.rrtype & 0xFF); in putEmptyResourceRecord()
1844 ptr[2] = (mDNSu8)(rr->resrec.rrclass >> 8); // Put class in putEmptyResourceRecord()
1845 ptr[3] = (mDNSu8)(rr->resrec.rrclass & 0xFF); in putEmptyResourceRecord()
1852 mDNSexport mDNSu8 *putQuestion(DNSMessage *const msg, mDNSu8 *ptr, const mDNSu8 *const limit, const… in putQuestion()
1856 ptr[0] = (mDNSu8)(rrtype >> 8); in putQuestion()
1857 ptr[1] = (mDNSu8)(rrtype & 0xFF); in putQuestion()
1858 ptr[2] = (mDNSu8)(rrclass >> 8); in putQuestion()
1859 ptr[3] = (mDNSu8)(rrclass & 0xFF); in putQuestion()
1865 mDNSexport mDNSu8 *putZone(DNSMessage *const msg, mDNSu8 *ptr, mDNSu8 *limit, const domainname *zon… in putZone()
1869 *ptr++ = (mDNSu8)(kDNSType_SOA >> 8); in putZone()
1870 *ptr++ = (mDNSu8)(kDNSType_SOA & 0xFF); in putZone()
1878 mDNSexport mDNSu8 *putPrereqNameNotInUse(const domainname *const name, DNSMessage *const msg, mDNSu… in putPrereqNameNotInUse()
1889 mDNSexport mDNSu8 *putDeletionRecord(DNSMessage *msg, mDNSu8 *ptr, ResourceRecord *rr) in putDeletionRecord()
1900 mDNSexport mDNSu8 *putDeletionRecordWithLimit(DNSMessage *msg, mDNSu8 *ptr, ResourceRecord *rr, mDN… in putDeletionRecordWithLimit()
1910 mDNSexport mDNSu8 *putDeleteRRSetWithLimit(DNSMessage *msg, mDNSu8 *ptr, const domainname *name, mD… in putDeleteRRSetWithLimit()
1916 ptr[0] = (mDNSu8)(rrtype >> 8); in putDeleteRRSetWithLimit()
1917 ptr[1] = (mDNSu8)(rrtype & 0xFF); in putDeleteRRSetWithLimit()
1918 ptr[2] = (mDNSu8)(class >> 8); in putDeleteRRSetWithLimit()
1919 ptr[3] = (mDNSu8)(class & 0xFF); in putDeleteRRSetWithLimit()
1928 mDNSexport mDNSu8 *putDeleteAllRRSets(DNSMessage *msg, mDNSu8 *ptr, const domainname *name) in putDeleteAllRRSets()
1930 const mDNSu8 *limit = msg->data + AbsoluteMaxDNSMessageData; in putDeleteAllRRSets()
1936 ptr[0] = (mDNSu8)(rrtype >> 8); in putDeleteAllRRSets()
1937 ptr[1] = (mDNSu8)(rrtype & 0xFF); in putDeleteAllRRSets()
1938 ptr[2] = (mDNSu8)(class >> 8); in putDeleteAllRRSets()
1939 ptr[3] = (mDNSu8)(class & 0xFF); in putDeleteAllRRSets()
1948 mDNSexport mDNSu8 *putUpdateLease(DNSMessage *msg, mDNSu8 *end, mDNSu32 lease) in putUpdateLease()
1963 mDNSexport mDNSu8 *putUpdateLeaseWithLimit(DNSMessage *msg, mDNSu8 *end, mDNSu32 lease, mDNSu8 *lim… in putUpdateLeaseWithLimit()
1977 mDNSexport mDNSu8 *putHINFO(const mDNS *const m, DNSMessage *const msg, mDNSu8 *end, DomainAuthInfo… in putHINFO()
1982 mDNSu8 *h = hinfo.rdatastorage.u.data; in putHINFO()
1984 mDNSu8 *newptr; in putHINFO()
2010 const mDNSu8 *c; in DomainNameHashValue()
2037 mDNSexport const mDNSu8 *skipDomainName(const DNSMessage *const msg, const mDNSu8 *ptr, const mDNSu… in skipDomainName()
2041 if (ptr < (mDNSu8*)msg || ptr >= end) in skipDomainName()
2046 const mDNSu8 len = *ptr++; // Read length of this label in skipDomainName()
2066 mDNSexport const mDNSu8 *getDomainName(const DNSMessage *const msg, const mDNSu8 *ptr, const mDNSu8… in getDomainName()
2069 …const mDNSu8 *nextbyte = mDNSNULL; // Record where we got to before we started following point… in getDomainName()
2070 mDNSu8 *np = name->c; // Name pointer in getDomainName()
2071 const mDNSu8 *const limit = np + MAX_DOMAIN_NAME; // Limit so we don't overrun buffer in getDomainName()
2073 if (ptr < (mDNSu8*)msg || ptr >= end) in getDomainName()
2080 const mDNSu8 len = *ptr++; // Read length of this label in getDomainName()
2103 ptr = (mDNSu8 *)msg + offset; in getDomainName()
2104 if (ptr < (mDNSu8*)msg || ptr >= end) in getDomainName()
2116 mDNSexport const mDNSu8 *skipResourceRecord(const DNSMessage *msg, const mDNSu8 *ptr, const mDNSu8 … in skipResourceRecord()
2131 mDNSexport const mDNSu8 *GetLargeResourceRecord(mDNS *const m, const DNSMessage *const msg, const m… in GetLargeResourceRecord()
2132 …const mDNSu8 *end, const mDNSInterfaceID InterfaceID, mDNSu8 RecordType, LargeCacheRecord *const l… in GetLargeResourceRecord()
2291 while (ptr < end && (mDNSu8 *)(opt+1) < &rr->resrec.rdata->u.data[MaximumRDSize]) in GetLargeResourceRecord()
2345 rr->resrec.rdlength = (mDNSu16)((mDNSu8*)opt - rr->resrec.rdata->u.data); in GetLargeResourceRecord()
2401 mDNSexport const mDNSu8 *skipQuestion(const DNSMessage *msg, const mDNSu8 *ptr, const mDNSu8 *end) in skipQuestion()
2409 mDNSexport const mDNSu8 *getQuestion(const DNSMessage *msg, const mDNSu8 *ptr, const mDNSu8 *end, c… in getQuestion()
2425 mDNSexport const mDNSu8 *LocateAnswers(const DNSMessage *const msg, const mDNSu8 *const end) in LocateAnswers()
2428 const mDNSu8 *ptr = msg->data; in LocateAnswers()
2433 mDNSexport const mDNSu8 *LocateAuthorities(const DNSMessage *const msg, const mDNSu8 *const end) in LocateAuthorities()
2436 const mDNSu8 *ptr = LocateAnswers(msg, end); in LocateAuthorities()
2441 mDNSexport const mDNSu8 *LocateAdditionals(const DNSMessage *const msg, const mDNSu8 *const end) in LocateAdditionals()
2444 const mDNSu8 *ptr = LocateAuthorities(msg, end); in LocateAdditionals()
2449 mDNSexport const mDNSu8 *LocateOptRR(const DNSMessage *const msg, const mDNSu8 *const end, int mins… in LocateOptRR()
2452 const mDNSu8 *ptr = LocateAdditionals(msg, end); in LocateOptRR()
2476 mDNSexport const rdataOPT *GetLLQOptData(mDNS *const m, const DNSMessage *const msg, const mDNSu8 *… in GetLLQOptData()
2478 const mDNSu8 *ptr = LocateOptRR(msg, end, DNSOpt_LLQData_Space); in GetLLQOptData()
2489 mDNSexport mDNSu32 GetPktLease(mDNS *m, DNSMessage *msg, const mDNSu8 *end) in GetPktLease()
2492 const mDNSu8 *ptr = LocateOptRR(msg, end, DNSOpt_LeaseData_Space); in GetPktLease()
2500 mDNSlocal const mDNSu8 *DumpRecords(mDNS *const m, const DNSMessage *const msg, const mDNSu8 *ptr, … in DumpRecords()
2541 const mDNSAddr *dstaddr, mDNSIPPort dstport, const DNSMessage *const msg, const mDNSu8 *const end) in DumpPacket()
2544 const mDNSu8 *ptr = msg->data; in DumpPacket()
2602 mDNSexport mStatus mDNSSendDNSMessage(mDNS *const m, DNSMessage *const msg, mDNSu8 *end, in mDNSSendDNSMessage()
2607 mDNSu8 *newend; in mDNSSendDNSMessage()
2608 mDNSu8 *limit = msg->data + AbsoluteMaxDNSMessageData; in mDNSSendDNSMessage()
2633 mDNSu16 msglen = (mDNSu16)(end - (mDNSu8 *)msg); in mDNSSendDNSMessage()
2634 mDNSu8 lenbuf[2] = { (mDNSu8)(msglen >> 8), (mDNSu8)(msglen & 0xFF) }; in mDNSSendDNSMessage()