aboutsummaryrefslogtreecommitdiffstats
path: root/pcap.3
diff options
context:
space:
mode:
Diffstat (limited to 'pcap.3')
-rw-r--r--pcap.316
1 files changed, 13 insertions, 3 deletions
diff --git a/pcap.3 b/pcap.3
index 18bcb4a..2dc98ea 100644
--- a/pcap.3
+++ b/pcap.3
@@ -1,4 +1,4 @@
-.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.12 2000-10-22 02:21:34 guy Exp $
+.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.13 2000-10-28 00:01:31 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@@ -62,6 +62,7 @@ int pcap_compile(pcap_t *p, struct bpf_program *fp,
.ti +8
char *str, int optimize, bpf_u_int32 netmask)
int pcap_setfilter(pcap_t *p, struct bpf_program *fp)
+void pcap_freecode(struct bpf_program *);
.ft
.LP
.ft B
@@ -256,14 +257,14 @@ is similar to
.B pcap_compile()
except that instead of passing a pcap structure, one passes the
snaplen and linktype explicitly. It is intended to be used for
-compiling filters for direct bpf usage, without necessarily having
+compiling filters for direct BPF usage, without necessarily having
called
.BR pcap_open() .
.PP
.B pcap_setfilter()
is used to specify a filter program.
.I fp
-is a pointer to an array of
+is a pointer to a
.I bpf_program
struct, usually the result of a call to
.BR pcap_compile() .
@@ -272,6 +273,15 @@ is returned on failure;
.B 0
is returned on success.
.PP
+.B pcap_freecode()
+is used to free up allocated memory pointed to by a
+.I bpf_program
+struct generated by
+.B pcap_compile()
+when that BPF program is no longer needed, for example after it
+has been made the filter program for a pcap structure by a call to
+.BR pcap_setfilter() .
+.PP
.B pcap_loop()
is similar to
.B pcap_dispatch()