Lines Matching defs:packet
151 #define MAX_ADDRS 32 /* maximum number of addresses from a single packet */
162 u8 *request; /* the dns packet data */
165 int tx_count; /* the number of times that this packet has been sent */
459 /* and wait longer to send the next probe packet. */
680 /* this processes a parsed reply packet */
756 name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) {
760 #define GET32(x) do { if (j + 4 > length) goto err; memcpy(&_t32, packet + j, 4); j += 4; x = ntohl(_t32); } while(0)
761 #define GET16(x) do { if (j + 2 > length) goto err; memcpy(&_t, packet + j, 2); j += 2; x = ntohs(_t); } while(0)
762 #define GET8(x) do { if (j >= length) goto err; x = packet[j++]; } while(0)
771 /* packet. */
796 memcpy(cp, packet + j, label_len);
813 reply_parse(u8 *packet, int length) {
814 int j = 0, k = 0; /* index into packet */
851 if (name_parse(packet, length, &j, tmp_name, sizeof(tmp_name))<0)\
858 if (name_parse(packet, length, &j, tmp_name, sizeof(tmp_name))<0)\
905 packet + j, 4*addrtocopy);
914 if (name_parse(packet, length, &j, reply.data.ptr.name,
934 packet + j, 16*addrtocopy);
953 /* Parse a raw request (packet,length) sent to a nameserver port (port) from */
957 request_parse(u8 *packet, int length, struct evdns_server_port *port, struct sockaddr *addr, socklen_t addrlen)
959 int j = 0; /* index into packet */
996 if (name_parse(packet, length, &j, tmp_name, sizeof(tmp_name))<0)
1170 u8 packet[1500];
1175 const int r = recvfrom(ns->socket, packet, sizeof(packet), 0,
1185 "DNS packet.");
1189 reply_parse(packet, r);
1193 /* Read a packet from a DNS client on a server port s, parse it, and */
1197 u8 packet[1500];
1204 r = recvfrom(s->socket, packet, sizeof(packet), 0,
1213 request_parse(packet, r, s, (struct sockaddr*) &addr, addrlen);
1445 /* build a dns request packet into buf. buf should be at least as long */
1946 /* if we fail to send this packet then this flag marks it */