Arnaldo Carvalho de Melo | 73c1f4a | 2005-08-12 12:51:49 -0300 | [diff] [blame] | 1 | #ifndef _INET_DIAG_H_ |
| 2 | #define _INET_DIAG_H_ 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 4 | #include <uapi/linux/inet_diag.h> |
Jaswinder Singh Rajput | 2df005b | 2009-01-30 21:42:47 +0530 | [diff] [blame] | 5 | |
Arnaldo Carvalho de Melo | 4f5736c | 2005-08-12 09:27:49 -0300 | [diff] [blame] | 6 | struct sock; |
| 7 | struct inet_hashinfo; |
Pavel Emelyanov | 8d07d15 | 2011-12-09 06:22:44 +0000 | [diff] [blame] | 8 | struct nlattr; |
Pavel Emelyanov | 3c4d05c | 2011-12-09 06:23:00 +0000 | [diff] [blame] | 9 | struct nlmsghdr; |
| 10 | struct sk_buff; |
Pavel Emelyanov | 1942c51 | 2011-12-09 06:23:18 +0000 | [diff] [blame] | 11 | struct netlink_callback; |
Arnaldo Carvalho de Melo | 4f5736c | 2005-08-12 09:27:49 -0300 | [diff] [blame] | 12 | |
| 13 | struct inet_diag_handler { |
Pavel Emelyanov | 1942c51 | 2011-12-09 06:23:18 +0000 | [diff] [blame] | 14 | void (*dump)(struct sk_buff *skb, |
| 15 | struct netlink_callback *cb, |
Pavel Emelyanov | c899136 | 2012-01-10 22:36:35 +0000 | [diff] [blame] | 16 | struct inet_diag_req_v2 *r, |
Pavel Emelyanov | 1942c51 | 2011-12-09 06:23:18 +0000 | [diff] [blame] | 17 | struct nlattr *bc); |
| 18 | |
| 19 | int (*dump_one)(struct sk_buff *in_skb, |
| 20 | const struct nlmsghdr *nlh, |
Pavel Emelyanov | c899136 | 2012-01-10 22:36:35 +0000 | [diff] [blame] | 21 | struct inet_diag_req_v2 *req); |
Pavel Emelyanov | 1942c51 | 2011-12-09 06:23:18 +0000 | [diff] [blame] | 22 | |
Arnaldo Carvalho de Melo | 4f5736c | 2005-08-12 09:27:49 -0300 | [diff] [blame] | 23 | void (*idiag_get_info)(struct sock *sk, |
Arnaldo Carvalho de Melo | 73c1f4a | 2005-08-12 12:51:49 -0300 | [diff] [blame] | 24 | struct inet_diag_msg *r, |
Arnaldo Carvalho de Melo | 4f5736c | 2005-08-12 09:27:49 -0300 | [diff] [blame] | 25 | void *info); |
Arnaldo Carvalho de Melo | 4f5736c | 2005-08-12 09:27:49 -0300 | [diff] [blame] | 26 | __u16 idiag_type; |
| 27 | }; |
| 28 | |
Pavel Emelyanov | 3c4d05c | 2011-12-09 06:23:00 +0000 | [diff] [blame] | 29 | struct inet_connection_sock; |
| 30 | int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, |
Pavel Emelyanov | c899136 | 2012-01-10 22:36:35 +0000 | [diff] [blame] | 31 | struct sk_buff *skb, struct inet_diag_req_v2 *req, |
Eric W. Biederman | d06ca95 | 2012-05-24 17:58:08 -0600 | [diff] [blame] | 32 | struct user_namespace *user_ns, |
Pavel Emelyanov | 3c4d05c | 2011-12-09 06:23:00 +0000 | [diff] [blame] | 33 | u32 pid, u32 seq, u16 nlmsg_flags, |
| 34 | const struct nlmsghdr *unlh); |
Pavel Emelyanov | 1942c51 | 2011-12-09 06:23:18 +0000 | [diff] [blame] | 35 | void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, |
Pavel Emelyanov | c899136 | 2012-01-10 22:36:35 +0000 | [diff] [blame] | 36 | struct netlink_callback *cb, struct inet_diag_req_v2 *r, |
Pavel Emelyanov | 1942c51 | 2011-12-09 06:23:18 +0000 | [diff] [blame] | 37 | struct nlattr *bc); |
| 38 | int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, |
| 39 | struct sk_buff *in_skb, const struct nlmsghdr *nlh, |
Pavel Emelyanov | c899136 | 2012-01-10 22:36:35 +0000 | [diff] [blame] | 40 | struct inet_diag_req_v2 *req); |
Pavel Emelyanov | 1942c51 | 2011-12-09 06:23:18 +0000 | [diff] [blame] | 41 | |
Pavel Emelyanov | 8d07d15 | 2011-12-09 06:22:44 +0000 | [diff] [blame] | 42 | int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk); |
Pavel Emelyanov | b005ab4 | 2011-12-09 06:21:53 +0000 | [diff] [blame] | 43 | |
Arnaldo Carvalho de Melo | 4f5736c | 2005-08-12 09:27:49 -0300 | [diff] [blame] | 44 | extern int inet_diag_register(const struct inet_diag_handler *handler); |
| 45 | extern void inet_diag_unregister(const struct inet_diag_handler *handler); |
Arnaldo Carvalho de Melo | 73c1f4a | 2005-08-12 12:51:49 -0300 | [diff] [blame] | 46 | #endif /* _INET_DIAG_H_ */ |