Linux BPF Extension Packet Addresses

This entire set of constants is also exported under the tag name :skf.

STRUCTURE FUNCTIONS

$buffer = pack_sock_filter( $code, $jt, $jf, $k )

( $code, $jt, $jf, $k ) = unpack_sock_filter( $buffer )

Pack or unpack a single BPF instruction.

SOCKET FUNCTIONS

The following exported functions are also provided as methods on the IO::Socket class.

attach_filter( $sock, $filter )

$sock->attach_filter( $filter )

Attaches the given filter program to the given socket. The program should be a string formed by concatenating multiple calls to pack_sock_filter() to build the filter program, or by using Linux::SocketFilter::Assembler.

detach_filter( $sock )

$sock->detach_filter()

Detaches the current filter from the socket, returning it to accepting all packets.