blob: 46cca4c06848346ca84753ac182526a4514ff277 [file] [log] [blame]
Pavel Emelyanovd3664772011-12-06 07:58:03 +00001#ifndef __SOCK_DIAG_H__
2#define __SOCK_DIAG_H__
Pavel Emelyanove7c466e2011-12-15 02:42:42 +00003
Nicolas Dichtele8d96122013-04-25 06:53:54 +00004#include <linux/user_namespace.h>
David Howells607ca462012-10-13 10:46:48 +01005#include <uapi/linux/sock_diag.h>
Pavel Emelyanove7c466e2011-12-15 02:42:42 +00006
Pavel Emelyanove6fe2372011-12-30 00:52:21 +00007struct sk_buff;
8struct nlmsghdr;
Pavel Emelyanov5d2e5f22011-12-30 00:53:13 +00009struct sock;
Pavel Emelyanove6fe2372011-12-30 00:52:21 +000010
Pavel Emelyanovd3664772011-12-06 07:58:03 +000011struct sock_diag_handler {
12 __u8 family;
13 int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
14};
15
Shan Wei8dcf01f2012-04-24 18:21:07 +000016int sock_diag_register(const struct sock_diag_handler *h);
17void sock_diag_unregister(const struct sock_diag_handler *h);
Pavel Emelyanovd3664772011-12-06 07:58:03 +000018
19void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
20void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
21
Pavel Emelyanovf65c1b52011-12-15 02:43:44 +000022int sock_diag_check_cookie(void *sk, __u32 *cookie);
23void sock_diag_save_cookie(void *sk, __u32 *cookie);
24
Pavel Emelyanov5d2e5f22011-12-30 00:53:13 +000025int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
Eric W. Biedermana53b72c2014-04-23 14:26:25 -070026int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk,
Nicolas Dichtele8d96122013-04-25 06:53:54 +000027 struct sk_buff *skb, int attrtype);
Pavel Emelyanov5d2e5f22011-12-30 00:53:13 +000028
Pavel Emelyanovd3664772011-12-06 07:58:03 +000029#endif