OSDN Git Service

iptables: Update original to iptables 1.8.4
[linuxjm/jm.git] / manual / iptables / original / man8 / nfbpf_compile.8
1 .TH NFBPF_COMPILE 8 "" "iptables 1.8.4" "iptables 1.8.4"
2
3 .SH NAME
4 nfbpf_compile \- generate bytecode for use with xt_bpf
5 .SH SYNOPSIS
6
7 .ad l
8 .in +8
9 .ti -8
10 .B nfbpf_compile
11 [
12 .I LLTYPE
13 ]
14 .I PROGRAM
15
16 .ti -8
17 .I LLTYPE
18 := {
19 .BR EN10MB " | " RAW " | " SLIP " | "
20 .I ...
21 }
22
23 .SH DESCRIPTION
24 The
25 .B nfbpf_compile
26 utility aids in generating BPF byte code suitable for passing to
27 the iptables
28 .B bpf
29 match.
30
31 .SH OPTIONS
32
33 .TP
34 .I LLTYPE
35 Link-layer header type to operate on. This is a name as defined in
36 .RB < pcap/dlt.h >
37 but with the leading
38 .B DLT_
39 prefix stripped. For use with iptables,
40 .B RAW
41 should be the right choice (it's also the default if not specified).
42
43 .TP
44 .I PROGRAM
45 The BPF expression to compile, see
46 .BR pcap-filter (7)
47 for a description of the language.
48
49 .SH EXIT STATUS
50 The program returns 0 on success, 1 otherwise.
51
52 .SH EXAMPLE
53 Match incoming TCP packets with size bigger than 100 bytes:
54 .P
55 .in +8
56 .EE
57 bpf=$(nfbpf_compile 'tcp and greater 100')
58 .br
59 iptables -A INPUT -m bpf --bytecode "$bpf" -j ACCEPT
60 .RE
61 .P
62 The description of
63 .B bpf
64 match in
65 .BR iptables-extensions (8)
66 lists a few more examples.
67
68 .SH SEE ALSO
69 .BR iptables-extensions (8),
70 .BR pcap-filter (7)