blob: 0e707f0c1a3ed1e747bf11ec9477fbae95468bff [file] [log] [blame]
Arnaldo Carvalho de Melo73c1f4a2005-08-12 12:51:49 -03001#ifndef _INET_DIAG_H_
2#define _INET_DIAG_H_ 1
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
David Howells607ca462012-10-13 10:46:48 +01004#include <uapi/linux/inet_diag.h>
Jaswinder Singh Rajput2df005b2009-01-30 21:42:47 +05305
Arnaldo Carvalho de Melo4f5736c2005-08-12 09:27:49 -03006struct sock;
7struct inet_hashinfo;
Pavel Emelyanov8d07d152011-12-09 06:22:44 +00008struct nlattr;
Pavel Emelyanov3c4d05c2011-12-09 06:23:00 +00009struct nlmsghdr;
10struct sk_buff;
Pavel Emelyanov1942c512011-12-09 06:23:18 +000011struct netlink_callback;
Arnaldo Carvalho de Melo4f5736c2005-08-12 09:27:49 -030012
13struct inet_diag_handler {
Eric Dumazet34160ea2015-03-10 07:15:54 -070014 void (*dump)(struct sk_buff *skb,
15 struct netlink_callback *cb,
16 const struct inet_diag_req_v2 *r,
17 struct nlattr *bc);
Pavel Emelyanov1942c512011-12-09 06:23:18 +000018
Eric Dumazet34160ea2015-03-10 07:15:54 -070019 int (*dump_one)(struct sk_buff *in_skb,
20 const struct nlmsghdr *nlh,
21 const struct inet_diag_req_v2 *req);
Pavel Emelyanov1942c512011-12-09 06:23:18 +000022
Eric Dumazet34160ea2015-03-10 07:15:54 -070023 void (*idiag_get_info)(struct sock *sk,
24 struct inet_diag_msg *r,
25 void *info);
26 __u16 idiag_type;
Craig Gallek3fd22af2015-06-15 11:26:19 -040027 __u16 idiag_info_size;
Arnaldo Carvalho de Melo4f5736c2005-08-12 09:27:49 -030028};
29
Pavel Emelyanov3c4d05c2011-12-09 06:23:00 +000030struct inet_connection_sock;
31int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
Eric Dumazet34160ea2015-03-10 07:15:54 -070032 struct sk_buff *skb, const struct inet_diag_req_v2 *req,
33 struct user_namespace *user_ns,
34 u32 pid, u32 seq, u16 nlmsg_flags,
35 const struct nlmsghdr *unlh);
Pavel Emelyanov1942c512011-12-09 06:23:18 +000036void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
Eric Dumazet34160ea2015-03-10 07:15:54 -070037 struct netlink_callback *cb,
38 const struct inet_diag_req_v2 *r,
39 struct nlattr *bc);
Pavel Emelyanov1942c512011-12-09 06:23:18 +000040int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
Eric Dumazet34160ea2015-03-10 07:15:54 -070041 struct sk_buff *in_skb, const struct nlmsghdr *nlh,
42 const struct inet_diag_req_v2 *req);
Pavel Emelyanov1942c512011-12-09 06:23:18 +000043
Pavel Emelyanov8d07d152011-12-09 06:22:44 +000044int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
Pavel Emelyanovb005ab42011-12-09 06:21:53 +000045
Arnaldo Carvalho de Melo4f5736c2005-08-12 09:27:49 -030046extern int inet_diag_register(const struct inet_diag_handler *handler);
47extern void inet_diag_unregister(const struct inet_diag_handler *handler);
Arnaldo Carvalho de Melo73c1f4a2005-08-12 12:51:49 -030048#endif /* _INET_DIAG_H_ */