timewait_sock.h 641 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * NET Generic infrastructure for Network protocols.
  4. *
  5. * Authors: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  6. */
  7. #ifndef _TIMEWAIT_SOCK_H
  8. #define _TIMEWAIT_SOCK_H
  9. #include <linux/slab.h>
  10. #include <linux/bug.h>
  11. #include <net/sock.h>
  12. struct timewait_sock_ops {
  13. struct kmem_cache *twsk_slab;
  14. char *twsk_slab_name;
  15. unsigned int twsk_obj_size;
  16. void (*twsk_destructor)(struct sock *sk);
  17. };
  18. static inline void twsk_destructor(struct sock *sk)
  19. {
  20. if (sk->sk_prot->twsk_prot->twsk_destructor != NULL)
  21. sk->sk_prot->twsk_prot->twsk_destructor(sk);
  22. }
  23. #endif /* _TIMEWAIT_SOCK_H */