• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef __SOCK_DIAG_H__
2 #define __SOCK_DIAG_H__
3 
4 #include <linux/user_namespace.h>
5 #include <uapi/linux/sock_diag.h>
6 
7 struct sk_buff;
8 struct nlmsghdr;
9 struct sock;
10 
11 struct sock_diag_handler {
12 	__u8 family;
13 	int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
14 	int (*destroy)(struct sk_buff *skb, struct nlmsghdr *nlh);
15 };
16 
17 int sock_diag_register(const struct sock_diag_handler *h);
18 void sock_diag_unregister(const struct sock_diag_handler *h);
19 
20 void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
21 void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
22 
23 int sock_diag_check_cookie(void *sk, __u32 *cookie);
24 void sock_diag_save_cookie(void *sk, __u32 *cookie);
25 
26 int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
27 int sock_diag_put_filterinfo(struct user_namespace *user_ns, struct sock *sk,
28 			     struct sk_buff *skb, int attrtype);
29 
30 int sock_diag_destroy(struct sock *sk, int err);
31 #endif
32