Lines Matching refs:snapshot

255 	p->snapshot = pcap_adjust_snapshot(p->linktype, hdr.snaplen);
366 * If it was done in cooked mode, p->snapshot was
369 * would be p->snapshot. However, a faked Ethernet
372 * would be p->snapshot + 14.
376 * cooked mode, and add 14 to the snapshot length.
377 * That means that, for a raw capture, the snapshot
382 * But don't grow the snapshot length past the
385 if (p->snapshot <= INT_MAX - 14)
386 p->snapshot += 14;
388 p->snapshot = INT_MAX;
395 * Choose the minimum of the file's snapshot length and 2K bytes;
398 * memory just because there's a huge snapshot length, as the
399 * snapshot length might be larger than the size of the largest
402 p->bufsize = p->snapshot;
543 * Is it bigger than the snapshot length?
548 if (hdr->caplen > (bpf_u_int32)p->snapshot) {
551 "snaplen of %d", hdr->caplen, p->snapshot);
561 if (hdr->caplen > (bpf_u_int32)p->snapshot) {
563 * The packet is bigger than the snapshot length
567 * over the BUFMOD problem and not setting the snapshot
571 * snapshot length correctly in the pcap file header,
572 * even though they don't set a snapshot length in bufmod
574 * packet if a snapshot length is specified); they should
576 * per-packet callback, to the snapshot length if it's
577 * greater than the snapshot length, so the code using
578 * libpcap should see the packet cut off at the snapshot
583 * set the snapshot length currectly in the file header
587 * to be big enough for the snapshot length, read up
588 * to the snapshot length, discard the rest of the
589 * packet, and report the snapshot length as the captured
591 * bigger than the snapshot length, because they might
593 * and might copy the packet into a snapshot-length-
602 * Grow the buffer to the snapshot length.
604 if (!grow_buffer(p, p->snapshot))
609 * Read the first p->snapshot bytes into the buffer.
611 amt_read = fread(p->buffer, 1, p->snapshot, fp);
612 if (amt_read != (bpf_u_int32)p->snapshot) {
627 p->snapshot, amt_read);
635 bytes_to_discard = hdr->caplen - p->snapshot;
662 hdr->caplen = p->snapshot;
665 * The packet is within the snapshot length for this file.
686 if (new_bufsize > (u_int)p->snapshot)
687 new_bufsize = p->snapshot;
772 if (sf_write_header(p, f, linktype, p->tzoff, p->snapshot) == -1) {
981 * the snapshot lengths don't match;
1050 if ((bpf_u_int32)p->snapshot != ph.snaplen) {
1060 if (sf_write_header(p, f, linktype, p->tzoff, p->snapshot) == -1) {