Lines Matching refs:p
210 _bprint_c( char* p, char* end, int c ) in _bprint_c() argument
212 if (p < end) { in _bprint_c()
213 if (p+1 == end) in _bprint_c()
214 *p++ = 0; in _bprint_c()
216 *p++ = (char) c; in _bprint_c()
217 *p = 0; in _bprint_c()
220 return p; in _bprint_c()
225 _bprint_b( char* p, char* end, const char* buf, int len ) in _bprint_b() argument
227 int avail = end - p; in _bprint_b()
230 return p; in _bprint_b()
235 memcpy( p, buf, avail ); in _bprint_b()
236 p += avail; in _bprint_b()
238 if (p < end) in _bprint_b()
239 p[0] = 0; in _bprint_b()
243 return p; in _bprint_b()
248 _bprint_s( char* p, char* end, const char* str ) in _bprint_s() argument
250 return _bprint_b(p, end, str, strlen(str)); in _bprint_s()
254 char* _bprint( char* p, char* end, const char* format, ... ) __DEBUG__;
255 char* _bprint( char* p, char* end, const char* format, ... ) in _bprint() argument
260 avail = end - p; in _bprint()
263 return p; in _bprint()
266 n = vsnprintf( p, avail, format, args); in _bprint()
273 p += n; in _bprint()
275 if (p == end) in _bprint()
276 p[-1] = 0; in _bprint()
278 return p; in _bprint()
283 _bprint_hex( char* p, char* end, unsigned value, int numDigits ) in _bprint_hex() argument
291 return _bprint_b(p, end, text, nn); in _bprint_hex()
296 _bprint_hexdump( char* p, char* end, const uint8_t* data, int datalen ) in _bprint_hexdump() argument
309 p = _bprint_c(p, end, ' '); in _bprint_hexdump()
310 p = _bprint_hex(p, end, data[nn], 2); in _bprint_hexdump()
313 p = _bprint_s(p, end, " "); in _bprint_hexdump()
315 p = _bprint_s(p, end, " "); in _bprint_hexdump()
323 p = _bprint_c(p, end, c); in _bprint_hexdump()
325 p = _bprint_c(p, end, '\n'); in _bprint_hexdump()
330 return p; in _bprint_hexdump()
339 char* p = buff, *end = p + sizeof(buff); in XLOG_BYTES() local
341 p = _bprint_hexdump(p, end, base, len); in XLOG_BYTES()
473 const uint8_t* p = packet->cursor + count; in _dnsPacket_skip() local
475 if (p > packet->end) in _dnsPacket_skip()
476 p = packet->end; in _dnsPacket_skip()
478 packet->cursor = p; in _dnsPacket_skip()
484 const uint8_t* p = packet->cursor; in _dnsPacket_readInt16() local
486 if (p+2 > packet->end) in _dnsPacket_readInt16()
489 packet->cursor = p+2; in _dnsPacket_readInt16()
490 return (p[0]<< 8) | p[1]; in _dnsPacket_readInt16()
502 const uint8_t* p = packet->cursor; in _dnsPacket_checkBytes() local
504 if (p + numBytes > packet->end) in _dnsPacket_checkBytes()
507 if (memcmp(p, bytes, numBytes) != 0) in _dnsPacket_checkBytes()
510 packet->cursor = p + numBytes; in _dnsPacket_checkBytes()
521 const uint8_t* p = packet->cursor; in _dnsPacket_checkQName() local
527 if (p >= end) in _dnsPacket_checkQName()
530 c = *p++; in _dnsPacket_checkQName()
533 packet->cursor = p; in _dnsPacket_checkQName()
541 p += c; in _dnsPacket_checkQName()
584 const uint8_t* p = packet->base; in _dnsPacket_checkQuery() local
587 if (p + DNS_HEADER_SIZE > packet->end) { in _dnsPacket_checkQuery()
594 if ((p[2] & 0xFC) != 0 || (p[3] & 0xCF) != 0) { in _dnsPacket_checkQuery()
618 qdCount = (p[4] << 8) | p[5]; in _dnsPacket_checkQuery()
619 anCount = (p[6] << 8) | p[7]; in _dnsPacket_checkQuery()
620 dnCount = (p[8] << 8) | p[9]; in _dnsPacket_checkQuery()
621 arCount = (p[10]<< 8) | p[11]; in _dnsPacket_checkQuery()
634 packet->cursor = p + DNS_HEADER_SIZE; in _dnsPacket_checkQuery()
649 const uint8_t* p = packet->cursor; in _dnsPacket_bprintQName() local
656 if (p >= end) in _dnsPacket_bprintQName()
659 c = *p++; in _dnsPacket_bprintQName()
662 packet->cursor = p; in _dnsPacket_bprintQName()
675 bp = _bprint_b(bp, bend, (const char*)p, c); in _dnsPacket_bprintQName()
677 p += c; in _dnsPacket_bprintQName()
687 _dnsPacket_bprintQR(DnsPacket* packet, char* p, char* end) in _dnsPacket_bprintQR() argument
702 p = _dnsPacket_bprintQName(packet, p, end); in _dnsPacket_bprintQR()
705 p = _bprint_s(p, end, " ("); in _dnsPacket_bprintQR()
715 p = _bprint_s(p, end, typeString); in _dnsPacket_bprintQR()
718 p = _bprint(p, end, "UNKNOWN-%d", typeCode); in _dnsPacket_bprintQR()
721 p = _bprint_c(p, end, ')'); in _dnsPacket_bprintQR()
725 return p; in _dnsPacket_bprintQR()
730 _dnsPacket_bprintQuery( DnsPacket* packet, char* p, char* end ) in _dnsPacket_bprintQuery() argument
735 p = _bprint_s(p, end, "RECURSIVE "); in _dnsPacket_bprintQuery()
743 p = _dnsPacket_bprintQR(packet, p, end); in _dnsPacket_bprintQuery()
745 return p; in _dnsPacket_bprintQuery()
763 const uint8_t* p = packet->cursor; in _dnsPacket_hashBytes() local
766 while (numBytes > 0 && p < end) { in _dnsPacket_hashBytes()
767 hash = hash*FNV_MULT ^ *p++; in _dnsPacket_hashBytes()
769 packet->cursor = p; in _dnsPacket_hashBytes()
777 const uint8_t* p = packet->cursor; in _dnsPacket_hashQName() local
783 if (p >= end) { /* should not happen */ in _dnsPacket_hashQName()
788 c = *p++; in _dnsPacket_hashQName()
797 if (p + c >= end) { in _dnsPacket_hashQName()
803 hash = hash*FNV_MULT ^ *p++; in _dnsPacket_hashQName()
807 packet->cursor = p; in _dnsPacket_hashQName()
1491 char temp[256], *p=temp, *end=p+sizeof(temp); in _dump_query() local
1495 p = _dnsPacket_bprintQuery(pack, p, end); in _dump_query()
1502 char temp[512], *p=temp, *end=p+sizeof(temp); in _cache_dump_mru() local
1505 p = _bprint(temp, end, "MRU LIST (%2d): ", cache->num_entries); in _cache_dump_mru()
1507 p = _bprint(p, end, " %d", e->id); in _cache_dump_mru()
2205 register int *p = info->dnsrch_offset; in _resolv_populate_res_for_net() local
2206 while (pp < statp->dnsrch + MAXDNSRCH && *p != -1) { in _resolv_populate_res_for_net()
2207 *pp++ = &statp->defdname[0] + *p++; in _resolv_populate_res_for_net()