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