2018-05-21 20:22:30 -06:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _LINUX_BPFILTER_H
|
|
|
|
#define _LINUX_BPFILTER_H
|
|
|
|
|
|
|
|
#include <uapi/linux/bpfilter.h>
|
2020-06-26 11:23:00 -06:00
|
|
|
#include <linux/usermode_driver.h>
|
2018-05-21 20:22:30 -06:00
|
|
|
|
|
|
|
struct sock;
|
2018-07-19 01:56:59 -06:00
|
|
|
int bpfilter_ip_set_sockopt(struct sock *sk, int optname, char __user *optval,
|
2018-05-21 20:22:30 -06:00
|
|
|
unsigned int optlen);
|
2018-07-19 01:56:59 -06:00
|
|
|
int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval,
|
|
|
|
int __user *optlen);
|
2019-01-08 10:24:34 -07:00
|
|
|
struct bpfilter_umh_ops {
|
|
|
|
struct umh_info info;
|
2019-01-08 10:25:10 -07:00
|
|
|
/* since ip_getsockopt() can run in parallel, serialize access to umh */
|
|
|
|
struct mutex lock;
|
2019-01-08 10:24:34 -07:00
|
|
|
int (*sockopt)(struct sock *sk, int optname,
|
|
|
|
char __user *optval,
|
|
|
|
unsigned int optlen, bool is_set);
|
2019-01-08 10:24:53 -07:00
|
|
|
int (*start)(void);
|
|
|
|
bool stop;
|
2019-01-08 10:24:34 -07:00
|
|
|
};
|
|
|
|
extern struct bpfilter_umh_ops bpfilter_ops;
|
2018-05-21 20:22:30 -06:00
|
|
|
#endif
|