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