# Packages
This benchmark reads in file <tempdir>/gopacket_benchmark.pcap and measures the time it takes to decode all packets from that file.
# Functions
CompileBPFFilter compiles and returns a BPF filter with given a link type and capture length.
DatalinkNameToVal returns pcap_datalink_name_to_val as int.
DatalinkValToDescription returns pcap_datalink_val_to_description as string.
DatalinkValToName returns pcap_datalink_val_to_name as string.
FindAllDevs attempts to enumerate all interfaces on the current machine.
NewBPF allows to create a BPF without requiring an existing handle.
NewInactiveHandle creates a new InactiveHandle, which wraps an un-activated PCAP handle.
OpenLive opens a device and returns a *Handle.
OpenOffline opens a file and returns its contents as a *Handle.
OpenOfflineFile returns contents of input file as a *Handle.
TimestampSourceFromString translates a string into a timestamp type, case insensitive.
Version returns pcap_lib_version.
# Constants
BlockForever causes it to block forever waiting for packets, when passed into SetTimeout or OpenLive, while still returning incoming packets to userland relatively quickly.
Direction values for Handle.SetDirection.
Direction values for Handle.SetDirection.
Direction values for Handle.SetDirection.
ErrNotActive is returned if handle is not activated.
MaxBpfInstructions is the maximum number of BPF instructions supported (BPF_MAXINSNS), taken from Linux kernel: include/uapi/linux/bpf_common.h
https://github.com/torvalds/linux/blob/master/include/uapi/linux/bpf_common.h.
NextErrorNoMorePackets is returned when reading from a file (OpenOffline) and EOF is reached.
NextError values.
NextError values.
NextError values.
NextError values.
# Variables
CannotSetRFMon is returned by SetRFMon if the handle does not allow setting RFMon because pcap_can_set_rfmon returns 0.
# Structs
BPF is a compiled filter program, useful for offline packet matching.
BPFInstruction is a byte encoded structure holding a BPF instruction.
Datalink describes the datalink.
Handle provides a connection to a pcap handle, allowing users to read packets off the wire (Next), inject packets onto the wire (Inject), and perform a number of other functions to affect and understand packet output.
InactiveHandle allows you to call pre-pcap_activate functions on your pcap handle to set it up just the way you'd like.
Interface describes a single network interface on a machine.
InterfaceAddress describes an address associated with an Interface.
Stats contains statistics on how many packets were handled by a pcap handle, and what was done with those packets.
# Type aliases
Direction is used by Handle.SetDirection.
NextError is the return code from a call to Next.
TimestampSource tells PCAP which type of timestamp to use for packets.