Lines Matching defs:packet
159 * So we pass the buffer in the API so we can loop on >1 packet. */
165 struct bpf_hdr packet;
179 else if ((size_t)bytes < sizeof(packet))
185 memcpy(&packet, iface->buffer + iface->buffer_pos,
186 sizeof(packet));
187 if (packet.bh_caplen != packet.bh_datalen)
188 goto next; /* Incomplete packet, drop. */
189 if (iface->buffer_pos + packet.bh_caplen + packet.bh_hdrlen >
192 payload = iface->buffer + packet.bh_hdrlen + ETHER_HDR_LEN;
193 bytes = packet.bh_caplen - ETHER_HDR_LEN;
198 iface->buffer_pos += BPF_WORDALIGN(packet.bh_hdrlen +
199 packet.bh_caplen);