Lines Matching refs:pack2
564 static int _dnsPacket_isEqualDomainName(DnsPacket* pack1, DnsPacket* pack2) { in _dnsPacket_isEqualDomainName() argument
567 const uint8_t* p2 = pack2->cursor; in _dnsPacket_isEqualDomainName()
568 const uint8_t* end2 = pack2->end; in _dnsPacket_isEqualDomainName()
581 pack2->cursor = p2; in _dnsPacket_isEqualDomainName()
602 static int _dnsPacket_isEqualBytes(DnsPacket* pack1, DnsPacket* pack2, int numBytes) { in _dnsPacket_isEqualBytes() argument
604 const uint8_t* p2 = pack2->cursor; in _dnsPacket_isEqualBytes()
606 if (p1 + numBytes > pack1->end || p2 + numBytes > pack2->end) return 0; in _dnsPacket_isEqualBytes()
611 pack2->cursor += numBytes; in _dnsPacket_isEqualBytes()
615 static int _dnsPacket_isEqualQR(DnsPacket* pack1, DnsPacket* pack2) { in _dnsPacket_isEqualQR() argument
617 if (!_dnsPacket_isEqualDomainName(pack1, pack2) || in _dnsPacket_isEqualQR()
618 !_dnsPacket_isEqualBytes(pack1, pack2, 2 + 2)) in _dnsPacket_isEqualQR()
624 static int _dnsPacket_isEqualRR(DnsPacket* pack1, DnsPacket* pack2) { in _dnsPacket_isEqualRR() argument
627 if (!_dnsPacket_isEqualQR(pack1, pack2) || !_dnsPacket_isEqualBytes(pack1, pack2, 4)) return 0; in _dnsPacket_isEqualRR()
631 rdlength2 = _dnsPacket_readInt16(pack2); in _dnsPacket_isEqualRR()
632 if (rdlength1 != rdlength2 || !_dnsPacket_isEqualBytes(pack1, pack2, rdlength1)) return 0; in _dnsPacket_isEqualRR()
637 static int _dnsPacket_isEqualQuery(DnsPacket* pack1, DnsPacket* pack2) { in _dnsPacket_isEqualQuery() argument
642 _dnsPacket_rewind(pack2); in _dnsPacket_isEqualQuery()
645 if ((pack1->base[2] & 1) != (pack2->base[2] & 1)) { in _dnsPacket_isEqualQuery()
650 if (pack1->base[3] != pack2->base[3]) { in _dnsPacket_isEqualQuery()
657 _dnsPacket_skip(pack2, 4); in _dnsPacket_isEqualQuery()
661 count2 = _dnsPacket_readInt16(pack2); in _dnsPacket_isEqualQuery()
669 _dnsPacket_skip(pack2, 4); in _dnsPacket_isEqualQuery()
673 arcount2 = _dnsPacket_readInt16(pack2); in _dnsPacket_isEqualQuery()
681 if (!_dnsPacket_isEqualQR(pack1, pack2)) { in _dnsPacket_isEqualQuery()
689 if (!_dnsPacket_isEqualRR(pack1, pack2)) { in _dnsPacket_isEqualQuery()
880 DnsPacket pack1[1], pack2[1]; in entry_equals() local
886 _dnsPacket_init(pack2, e2->query, e2->querylen); in entry_equals()
888 return _dnsPacket_isEqualQuery(pack1, pack2); in entry_equals()