1d2ba09c1SAlexei Starovoitov /* SPDX-License-Identifier: GPL-2.0 */ 2d2ba09c1SAlexei Starovoitov #ifndef _LINUX_BPFILTER_H 3d2ba09c1SAlexei Starovoitov #define _LINUX_BPFILTER_H 4d2ba09c1SAlexei Starovoitov 5d2ba09c1SAlexei Starovoitov #include <uapi/linux/bpfilter.h> 6884c5e68SEric W. Biederman #include <linux/usermode_driver.h> 7b03afaa8SChristoph Hellwig #include <linux/sockptr.h> 8d2ba09c1SAlexei Starovoitov 9d2ba09c1SAlexei Starovoitov struct sock; 10b03afaa8SChristoph Hellwig int bpfilter_ip_set_sockopt(struct sock *sk, int optname, sockptr_t optval, 11d2ba09c1SAlexei Starovoitov unsigned int optlen); 12f95de8aaSYueHaibing int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval, 13f95de8aaSYueHaibing int __user *optlen); 14e80eb1dcSEric W. Biederman 155b4cb650STaehee Yoo struct bpfilter_umh_ops { 1674be2d3bSEric W. Biederman struct umd_info info; 1771a85084STaehee Yoo /* since ip_getsockopt() can run in parallel, serialize access to umh */ 1871a85084STaehee Yoo struct mutex lock; 19b03afaa8SChristoph Hellwig int (*sockopt)(struct sock *sk, int optname, sockptr_t optval, 20d2ba09c1SAlexei Starovoitov unsigned int optlen, bool is_set); 2161fbf593STaehee Yoo int (*start)(void); 225b4cb650STaehee Yoo }; 235b4cb650STaehee Yoo extern struct bpfilter_umh_ops bpfilter_ops; 24d2ba09c1SAlexei Starovoitov #endif 25