• Home
  • Raw
  • Download

Lines Matching refs:packet

476 _dnsPacket_init( DnsPacket*  packet, const uint8_t*  buff, int  bufflen )  in _dnsPacket_init()  argument
478 packet->base = buff; in _dnsPacket_init()
479 packet->end = buff + bufflen; in _dnsPacket_init()
480 packet->cursor = buff; in _dnsPacket_init()
484 _dnsPacket_rewind( DnsPacket* packet ) in _dnsPacket_rewind() argument
486 packet->cursor = packet->base; in _dnsPacket_rewind()
490 _dnsPacket_skip( DnsPacket* packet, int count ) in _dnsPacket_skip() argument
492 const uint8_t* p = packet->cursor + count; in _dnsPacket_skip()
494 if (p > packet->end) in _dnsPacket_skip()
495 p = packet->end; in _dnsPacket_skip()
497 packet->cursor = p; in _dnsPacket_skip()
501 _dnsPacket_readInt16( DnsPacket* packet ) in _dnsPacket_readInt16() argument
503 const uint8_t* p = packet->cursor; in _dnsPacket_readInt16()
505 if (p+2 > packet->end) in _dnsPacket_readInt16()
508 packet->cursor = p+2; in _dnsPacket_readInt16()
519 _dnsPacket_checkBytes( DnsPacket* packet, int numBytes, const void* bytes ) in _dnsPacket_checkBytes() argument
521 const uint8_t* p = packet->cursor; in _dnsPacket_checkBytes()
523 if (p + numBytes > packet->end) in _dnsPacket_checkBytes()
529 packet->cursor = p + numBytes; in _dnsPacket_checkBytes()
538 _dnsPacket_checkQName( DnsPacket* packet ) in _dnsPacket_checkQName() argument
540 const uint8_t* p = packet->cursor; in _dnsPacket_checkQName()
541 const uint8_t* end = packet->end; in _dnsPacket_checkQName()
552 packet->cursor = p; in _dnsPacket_checkQName()
573 _dnsPacket_checkQR( DnsPacket* packet ) in _dnsPacket_checkQR() argument
575 if (!_dnsPacket_checkQName(packet)) in _dnsPacket_checkQR()
579 if (!_dnsPacket_checkBytes(packet, 2, DNS_TYPE_A) && in _dnsPacket_checkQR()
580 !_dnsPacket_checkBytes(packet, 2, DNS_TYPE_PTR) && in _dnsPacket_checkQR()
581 !_dnsPacket_checkBytes(packet, 2, DNS_TYPE_MX) && in _dnsPacket_checkQR()
582 !_dnsPacket_checkBytes(packet, 2, DNS_TYPE_AAAA) && in _dnsPacket_checkQR()
583 !_dnsPacket_checkBytes(packet, 2, DNS_TYPE_ALL)) in _dnsPacket_checkQR()
589 if (!_dnsPacket_checkBytes(packet, 2, DNS_CLASS_IN)) { in _dnsPacket_checkQR()
601 _dnsPacket_checkQuery( DnsPacket* packet ) in _dnsPacket_checkQuery() argument
603 const uint8_t* p = packet->base; in _dnsPacket_checkQuery()
606 if (p + DNS_HEADER_SIZE > packet->end) { in _dnsPacket_checkQuery()
653 packet->cursor = p + DNS_HEADER_SIZE; in _dnsPacket_checkQuery()
656 if (!_dnsPacket_checkQR(packet)) in _dnsPacket_checkQuery()
666 _dnsPacket_bprintQName(DnsPacket* packet, char* bp, char* bend) in _dnsPacket_bprintQName() argument
668 const uint8_t* p = packet->cursor; in _dnsPacket_bprintQName()
669 const uint8_t* end = packet->end; in _dnsPacket_bprintQName()
681 packet->cursor = p; in _dnsPacket_bprintQName()
706 _dnsPacket_bprintQR(DnsPacket* packet, char* p, char* end) in _dnsPacket_bprintQR() argument
721 p = _dnsPacket_bprintQName(packet, p, end); in _dnsPacket_bprintQR()
727 if (_dnsPacket_checkBytes(packet, 2, qTypes[nn].typeBytes)) { in _dnsPacket_bprintQR()
736 int typeCode = _dnsPacket_readInt16(packet); in _dnsPacket_bprintQR()
743 _dnsPacket_skip(packet, 2); in _dnsPacket_bprintQR()
749 _dnsPacket_bprintQuery( DnsPacket* packet, char* p, char* end ) in _dnsPacket_bprintQuery() argument
753 if (packet->base[2] & 0x1) { in _dnsPacket_bprintQuery()
757 _dnsPacket_skip(packet, 4); in _dnsPacket_bprintQuery()
758 qdCount = _dnsPacket_readInt16(packet); in _dnsPacket_bprintQuery()
759 _dnsPacket_skip(packet, 6); in _dnsPacket_bprintQuery()
762 p = _dnsPacket_bprintQR(packet, p, end); in _dnsPacket_bprintQuery()
780 _dnsPacket_hashBytes( DnsPacket* packet, int numBytes, unsigned hash ) in _dnsPacket_hashBytes() argument
782 const uint8_t* p = packet->cursor; in _dnsPacket_hashBytes()
783 const uint8_t* end = packet->end; in _dnsPacket_hashBytes()
788 packet->cursor = p; in _dnsPacket_hashBytes()
794 _dnsPacket_hashQName( DnsPacket* packet, unsigned hash ) in _dnsPacket_hashQName() argument
796 const uint8_t* p = packet->cursor; in _dnsPacket_hashQName()
797 const uint8_t* end = packet->end; in _dnsPacket_hashQName()
826 packet->cursor = p; in _dnsPacket_hashQName()
831 _dnsPacket_hashQR( DnsPacket* packet, unsigned hash ) in _dnsPacket_hashQR() argument
833 hash = _dnsPacket_hashQName(packet, hash); in _dnsPacket_hashQR()
834 hash = _dnsPacket_hashBytes(packet, 4, hash); /* TYPE and CLASS */ in _dnsPacket_hashQR()
839 _dnsPacket_hashQuery( DnsPacket* packet ) in _dnsPacket_hashQuery() argument
843 _dnsPacket_rewind(packet); in _dnsPacket_hashQuery()
852 hash = hash*FNV_MULT ^ (packet->base[2] & 1); in _dnsPacket_hashQuery()
855 _dnsPacket_skip(packet, 4); in _dnsPacket_hashQuery()
858 count = _dnsPacket_readInt16(packet); in _dnsPacket_hashQuery()
861 _dnsPacket_skip(packet, 6); in _dnsPacket_hashQuery()
865 hash = _dnsPacket_hashQR(packet, hash); in _dnsPacket_hashQuery()