Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pfopen(3) [osf1 man page]

pfopen(3)						     Library Functions Manual							 pfopen(3)

NAME
pfopen - Open a packet filter file SYNOPSIS
pfopen(ifname, flags) char *ifname; int flags; DESCRIPTION
The packet filter (see packetfilter(7)) provides raw access to Ethernets and similar network data link layers. The routine pfopen is used to open a packet filter file descriptor. The routine hides various details about the way packet filter files are opened and named. The ifname argument is a pointer to a null-terminated string containing the name of the interface for which the application is opening the packet filter. This name may be the name of an actual interface on the system (for example, ln0) or it may be a pseudo-interface name of the form pfn, used to specify the nth interface attached to the system. For example, pf0 specifies the first such interface. If ifname is NULL, the default interface (pf0) is used. The flags argument has the same meaning as the corresponding argument to the open(2) system call. The file descriptor returned by pfopen is otherwise identical to one returned by open(2). ERRORS
The pfopen routine returns a negative integer if the file could not be opened. This may be because of resource limitations, or because the specified interface does not exist. RELATED INFORMATION
Commands: open(2) Files: bpf(7), packetfilter(7) delim off pfopen(3)

Check Out this Related Man Page

PFLOG(4)						   BSD Kernel Interfaces Manual 						  PFLOG(4)

NAME
pflog -- packet filter logging interface SYNOPSIS
device pflog DESCRIPTION
The pflog interface is a pseudo-device which makes visible all packets logged by the packet filter, pf(4). Logged packets can easily be mon- itored in real time by invoking tcpdump(1) on the pflog interface, or stored to disk using pflogd(8). The pflog0 interface is created automatically at boot if both pf(4) and pflogd(8) are enabled; further instances can be created using ifconfig(8). Each packet retrieved on this interface has a header associated with it of length PFLOG_HDRLEN. This header documents the address family, interface name, rule number, reason, action, and direction of the packet that was logged. This structure, defined in <net/if_pflog.h> looks like struct pfloghdr { u_int8_t length; sa_family_t af; u_int8_t action; u_int8_t reason; char ifname[IFNAMSIZ]; char ruleset[PF_RULESET_NAME_SIZE]; u_int32_t rulenr; u_int32_t subrulenr; uid_t uid; pid_t pid; uid_t rule_uid; pid_t rule_pid; u_int8_t dir; u_int8_t pad[3]; }; EXAMPLES
Create a pflog interface and monitor all packets logged on it: # ifconfig pflog1 up # tcpdump -n -e -ttt -i pflog1 SEE ALSO
tcpdump(1) inet(4), inet6(4), netintro(4), pf(4), ifconfig(8), pflogd(8) HISTORY
The pflog device first appeared in OpenBSD 3.0. BSD
December 10, 2001 BSD
Man Page