0001
0002
0003
0004
0005
0006
0007 #ifndef _TIMEWAIT_SOCK_H
0008 #define _TIMEWAIT_SOCK_H
0009
0010 #include <linux/slab.h>
0011 #include <linux/bug.h>
0012 #include <net/sock.h>
0013
0014 struct timewait_sock_ops {
0015 struct kmem_cache *twsk_slab;
0016 char *twsk_slab_name;
0017 unsigned int twsk_obj_size;
0018 int (*twsk_unique)(struct sock *sk,
0019 struct sock *sktw, void *twp);
0020 void (*twsk_destructor)(struct sock *sk);
0021 };
0022
0023 static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
0024 {
0025 if (sk->sk_prot->twsk_prot->twsk_unique != NULL)
0026 return sk->sk_prot->twsk_prot->twsk_unique(sk, sktw, twp);
0027 return 0;
0028 }
0029
0030 static inline void twsk_destructor(struct sock *sk)
0031 {
0032 if (sk->sk_prot->twsk_prot->twsk_destructor != NULL)
0033 sk->sk_prot->twsk_prot->twsk_destructor(sk);
0034 }
0035
0036 #endif