Module epcap_compile

Copyright © 2012-2020 Michael Santos <michael.santos@gmail.com>

Data Types

compile_options()

compile_options() = [{optimize, true | false} | {netmask, non_neg_integer()} | {dlt, integer()} | {snaplen, integer()} | {limit, integer()}]

Function Index

compile/1Compile a PCAP filter to a BPF program.
compile/2Compile a PCAP filter to a BPF program.

Function Details

compile/1

compile(Filter::iodata()) -> {ok, [binary()]} | {error, string()}

Compile a PCAP filter to a BPF program

Filter is a string in pcap-filter(7) format.

compile/1 defaults to:

* optimization enabled

* an unspecified netmask (filters specifying the broadcast will return an error)

* datalinktype set to ethernet (DLT_EN10MB)

* a packet length of 65535 bytes

* a limit of 8192 bytes for filters. Filters larger than this limit will return {error, enomem}. A limit less than 0 disables the length check.

compile/2

compile(Filter::iodata(), Options::compile_options()) -> {ok, [binary()]} | {error, string()}

Compile a PCAP filter to a BPF program

Filter is a string in pcap-filter(7) format.

See pcap_compile(3PCAP) for documentation about each option.


Generated by EDoc