Lines Matching refs:p
41 uchar *p, *pkt; in dns_send() local
48 p = pkt; in dns_send()
61 p = (uchar *)&header->data; /* For encoding host name into packet */ in dns_send()
69 *p++ = n; /* Copy length */ in dns_send()
70 memcpy(p, name, n); /* Copy chunk */ in dns_send()
71 p += n; in dns_send()
80 *p++ = 0; /* Mark end of host name */ in dns_send()
81 *p++ = 0; /* Some servers require double null */ in dns_send()
82 *p++ = (unsigned char) qtype; /* Query Type */ in dns_send()
84 *p++ = 0; in dns_send()
85 *p++ = 1; /* Class: inet, 0x0001 */ in dns_send()
87 n = p - pkt; /* Total packet length */ in dns_send()
107 const unsigned char *p, *e, *s; in dns_handler() local
137 for (p = s; p < e && *p != '\0'; p++) in dns_handler()
141 if (&p[5] > e || get_unaligned_be16(p+1) != DNS_A_RECORD) { in dns_handler()
148 p += 5; in dns_handler()
151 for (found = stop = 0; !stop && &p[12] < e; ) { in dns_handler()
153 if (*p != 0xc0) { in dns_handler()
154 while (*p && &p[12] < e) in dns_handler()
155 p++; in dns_handler()
156 p--; in dns_handler()
158 debug("Name (Offset in header): %d\n", p[1]); in dns_handler()
160 type = get_unaligned_be16(p+2); in dns_handler()
165 dlen = get_unaligned_be16(p+10); in dns_handler()
167 p += 12 + dlen; in dns_handler()
178 if (found && &p[12] < e) { in dns_handler()
179 dlen = get_unaligned_be16(p+10); in dns_handler()
180 p += 12; in dns_handler()
181 memcpy(&ip_addr, p, 4); in dns_handler()
183 if (p + dlen <= e) { in dns_handler()