sock_reuseport.h 824 B

1234567891011121314151617181920212223242526272829
  1. #ifndef _SOCK_REUSEPORT_H
  2. #define _SOCK_REUSEPORT_H
  3. #include <linux/filter.h>
  4. #include <linux/skbuff.h>
  5. #include <linux/types.h>
  6. #include <net/sock.h>
  7. struct sock_reuseport {
  8. struct rcu_head rcu;
  9. u16 max_socks; /* length of socks */
  10. u16 num_socks; /* elements in socks */
  11. struct bpf_prog __rcu *prog; /* optional BPF sock selector */
  12. struct sock *socks[0]; /* array of sock pointers */
  13. };
  14. extern int reuseport_alloc(struct sock *sk);
  15. extern int reuseport_add_sock(struct sock *sk, struct sock *sk2);
  16. extern void reuseport_detach_sock(struct sock *sk);
  17. extern struct sock *reuseport_select_sock(struct sock *sk,
  18. u32 hash,
  19. struct sk_buff *skb,
  20. int hdr_len);
  21. extern struct bpf_prog *reuseport_attach_prog(struct sock *sk,
  22. struct bpf_prog *prog);
  23. #endif /* _SOCK_REUSEPORT_H */