]>
Commit | Line | Data |
---|---|---|
73c1f4a0 ACM |
1 | #ifndef _INET_DIAG_H_ |
2 | #define _INET_DIAG_H_ 1 | |
1da177e4 | 3 | |
607ca46e | 4 | #include <uapi/linux/inet_diag.h> |
2df005b7 | 5 | |
b613f56e | 6 | struct net; |
4f5736c4 ACM |
7 | struct sock; |
8 | struct inet_hashinfo; | |
8d07d151 | 9 | struct nlattr; |
3c4d05c8 PE |
10 | struct nlmsghdr; |
11 | struct sk_buff; | |
1942c518 | 12 | struct netlink_callback; |
4f5736c4 ACM |
13 | |
14 | struct inet_diag_handler { | |
34160ea3 ED |
15 | void (*dump)(struct sk_buff *skb, |
16 | struct netlink_callback *cb, | |
17 | const struct inet_diag_req_v2 *r, | |
18 | struct nlattr *bc); | |
19 | ||
20 | int (*dump_one)(struct sk_buff *in_skb, | |
21 | const struct nlmsghdr *nlh, | |
22 | const struct inet_diag_req_v2 *req); | |
23 | ||
24 | void (*idiag_get_info)(struct sock *sk, | |
25 | struct inet_diag_msg *r, | |
26 | void *info); | |
6eb5d2e0 | 27 | |
b37e8840 ID |
28 | int (*idiag_get_aux)(struct sock *sk, |
29 | bool net_admin, | |
30 | struct sk_buff *skb); | |
31 | ||
32 | size_t (*idiag_get_aux_size)(struct sock *sk, | |
33 | bool net_admin); | |
34 | ||
6eb5d2e0 LC |
35 | int (*destroy)(struct sk_buff *in_skb, |
36 | const struct inet_diag_req_v2 *req); | |
37 | ||
34160ea3 | 38 | __u16 idiag_type; |
3fd22af8 | 39 | __u16 idiag_info_size; |
4f5736c4 ACM |
40 | }; |
41 | ||
3c4d05c8 PE |
42 | struct inet_connection_sock; |
43 | int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, | |
34160ea3 ED |
44 | struct sk_buff *skb, const struct inet_diag_req_v2 *req, |
45 | struct user_namespace *user_ns, | |
46 | u32 pid, u32 seq, u16 nlmsg_flags, | |
d545caca | 47 | const struct nlmsghdr *unlh, bool net_admin); |
1942c518 | 48 | void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, |
34160ea3 ED |
49 | struct netlink_callback *cb, |
50 | const struct inet_diag_req_v2 *r, | |
51 | struct nlattr *bc); | |
1942c518 | 52 | int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, |
34160ea3 ED |
53 | struct sk_buff *in_skb, const struct nlmsghdr *nlh, |
54 | const struct inet_diag_req_v2 *req); | |
1942c518 | 55 | |
b613f56e LC |
56 | struct sock *inet_diag_find_one_icsk(struct net *net, |
57 | struct inet_hashinfo *hashinfo, | |
58 | const struct inet_diag_req_v2 *req); | |
59 | ||
8d07d151 | 60 | int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk); |
b005ab4e | 61 | |
c3ec5e5c BD |
62 | void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk); |
63 | ||
64 | int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb, | |
65 | struct inet_diag_msg *r, int ext, | |
d545caca | 66 | struct user_namespace *user_ns, bool net_admin); |
c3ec5e5c | 67 | |
4f5736c4 ACM |
68 | extern int inet_diag_register(const struct inet_diag_handler *handler); |
69 | extern void inet_diag_unregister(const struct inet_diag_handler *handler); | |
73c1f4a0 | 70 | #endif /* _INET_DIAG_H_ */ |