'\" t .\" Title: sk_filter .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: September 2016 .\" Manual: Linux Networking .\" Source: Kernel Hackers Manual 3.16.36 .\" Language: English .\" .TH "SK_FILTER" "9" "September 2016" "Kernel Hackers Manual 3\&.16\&" "Linux Networking" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" sk_filter \- run a packet through a socket filter .SH "SYNOPSIS" .HP \w'int\ sk_filter('u .BI "int sk_filter(struct\ sock\ *\ " "sk" ", struct\ sk_buff\ *\ " "skb" ");" .SH "ARGUMENTS" .PP \fIsk\fR .RS 4 sock associated with sk_buff .RE .PP \fIskb\fR .RS 4 buffer to filter .RE .SH "DESCRIPTION" .PP Run the filter code and then cut skb\->data to correct size returned by sk_run_filter\&. If pkt_len is 0 we toss packet\&. If skb\->len is smaller than pkt_len we keep whole skb\->data\&. This is the socket level wrapper to sk_run_filter\&. It returns 0 if the packet should be accepted or \-EPERM if the packet should be tossed\&. .SH "COPYRIGHT" .br