Deleted Added
full compact
pcap-pf.c (17683) pcap-pf.c (26175)
1/*
2 * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1/*
2 * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 */
21#ifndef lint
22static char rcsid[] =
23 "@(#)$Header: pcap-pf.c,v 1.50 96/07/16 14:30:28 vern Exp $ (LBL)";
24#endif
25
26/*
20 *
27 * packet filter subroutines for tcpdump
28 * Extraction/creation by Jeffrey Mogul, DECWRL
21 * packet filter subroutines for tcpdump
22 * Extraction/creation by Jeffrey Mogul, DECWRL
29 *
30 * Extracted from tcpdump.c.
31 */
32
23 */
24
25#ifndef lint
26static const char rcsid[] =
27 "@(#) $Header: pcap-pf.c,v 1.54 96/12/10 23:15:01 leres Exp $ (LBL)";
28#endif
29
33#include <sys/types.h>
34#include <sys/time.h>
35#include <sys/timeb.h>
36#include <sys/socket.h>
37#include <sys/file.h>
38#include <sys/ioctl.h>
39#include <net/pfilt.h>
40

--- 244 unchanged lines hidden (view full) ---

285 snaplen += pcap_fddipad;
286#endif
287 if (ioctl(p->fd, EIOCTRUNCATE, (caddr_t)&snaplen) < 0) {
288 sprintf(ebuf, "EIOCTRUNCATE: %s", pcap_strerror(errno));
289 goto bad;
290 }
291 p->snapshot = snaplen;
292 /* accept all packets */
30#include <sys/types.h>
31#include <sys/time.h>
32#include <sys/timeb.h>
33#include <sys/socket.h>
34#include <sys/file.h>
35#include <sys/ioctl.h>
36#include <net/pfilt.h>
37

--- 244 unchanged lines hidden (view full) ---

282 snaplen += pcap_fddipad;
283#endif
284 if (ioctl(p->fd, EIOCTRUNCATE, (caddr_t)&snaplen) < 0) {
285 sprintf(ebuf, "EIOCTRUNCATE: %s", pcap_strerror(errno));
286 goto bad;
287 }
288 p->snapshot = snaplen;
289 /* accept all packets */
290 bzero((char *)&Filter, sizeof(Filter));
293 Filter.enf_Priority = 37; /* anything > 2 */
294 Filter.enf_FilterLen = 0; /* means "always true" */
295 if (ioctl(p->fd, EIOCSETF, (caddr_t)&Filter) < 0) {
296 sprintf(ebuf, "EIOCSETF: %s", pcap_strerror(errno));
297 goto bad;
298 }
299
300 if (to_ms != 0) {

--- 53 unchanged lines hidden ---
291 Filter.enf_Priority = 37; /* anything > 2 */
292 Filter.enf_FilterLen = 0; /* means "always true" */
293 if (ioctl(p->fd, EIOCSETF, (caddr_t)&Filter) < 0) {
294 sprintf(ebuf, "EIOCSETF: %s", pcap_strerror(errno));
295 goto bad;
296 }
297
298 if (to_ms != 0) {

--- 53 unchanged lines hidden ---