bpfilter.h 791 B

12345678910111213141516171819202122232425
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_BPFILTER_H
  3. #define _LINUX_BPFILTER_H
  4. #include <uapi/linux/bpfilter.h>
  5. #include <linux/usermode_driver.h>
  6. #include <linux/sockptr.h>
  7. struct sock;
  8. int bpfilter_ip_set_sockopt(struct sock *sk, int optname, sockptr_t optval,
  9. unsigned int optlen);
  10. int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval,
  11. int __user *optlen);
  12. void bpfilter_umh_cleanup(struct umd_info *info);
  13. struct bpfilter_umh_ops {
  14. struct umd_info info;
  15. /* since ip_getsockopt() can run in parallel, serialize access to umh */
  16. struct mutex lock;
  17. int (*sockopt)(struct sock *sk, int optname, sockptr_t optval,
  18. unsigned int optlen, bool is_set);
  19. int (*start)(void);
  20. };
  21. extern struct bpfilter_umh_ops bpfilter_ops;
  22. #endif