2005-08-12 15:51:49 +00:00
|
|
|
#ifndef _INET_DIAG_H_
|
|
|
|
#define _INET_DIAG_H_ 1
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2012-10-13 09:46:48 +00:00
|
|
|
#include <uapi/linux/inet_diag.h>
|
2009-01-30 16:12:47 +00:00
|
|
|
|
2015-12-16 03:30:02 +00:00
|
|
|
struct net;
|
2005-08-12 12:27:49 +00:00
|
|
|
struct sock;
|
|
|
|
struct inet_hashinfo;
|
2011-12-09 06:22:44 +00:00
|
|
|
struct nlattr;
|
2011-12-09 06:23:00 +00:00
|
|
|
struct nlmsghdr;
|
|
|
|
struct sk_buff;
|
2011-12-09 06:23:18 +00:00
|
|
|
struct netlink_callback;
|
2005-08-12 12:27:49 +00:00
|
|
|
|
|
|
|
struct inet_diag_handler {
|
2015-03-10 14:15:54 +00:00
|
|
|
void (*dump)(struct sk_buff *skb,
|
|
|
|
struct netlink_callback *cb,
|
|
|
|
const struct inet_diag_req_v2 *r,
|
|
|
|
struct nlattr *bc);
|
|
|
|
|
|
|
|
int (*dump_one)(struct sk_buff *in_skb,
|
|
|
|
const struct nlmsghdr *nlh,
|
|
|
|
const struct inet_diag_req_v2 *req);
|
|
|
|
|
|
|
|
void (*idiag_get_info)(struct sock *sk,
|
|
|
|
struct inet_diag_msg *r,
|
|
|
|
void *info);
|
2015-12-16 03:30:04 +00:00
|
|
|
|
|
|
|
int (*destroy)(struct sk_buff *in_skb,
|
|
|
|
const struct inet_diag_req_v2 *req);
|
|
|
|
|
2015-03-10 14:15:54 +00:00
|
|
|
__u16 idiag_type;
|
2015-06-15 15:26:19 +00:00
|
|
|
__u16 idiag_info_size;
|
2005-08-12 12:27:49 +00:00
|
|
|
};
|
|
|
|
|
2011-12-09 06:23:00 +00:00
|
|
|
struct inet_connection_sock;
|
|
|
|
int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
|
2015-03-10 14:15:54 +00:00
|
|
|
struct sk_buff *skb, const struct inet_diag_req_v2 *req,
|
|
|
|
struct user_namespace *user_ns,
|
|
|
|
u32 pid, u32 seq, u16 nlmsg_flags,
|
2016-09-07 15:42:25 +00:00
|
|
|
const struct nlmsghdr *unlh, bool net_admin);
|
2011-12-09 06:23:18 +00:00
|
|
|
void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
|
2015-03-10 14:15:54 +00:00
|
|
|
struct netlink_callback *cb,
|
|
|
|
const struct inet_diag_req_v2 *r,
|
|
|
|
struct nlattr *bc);
|
2011-12-09 06:23:18 +00:00
|
|
|
int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
|
2015-03-10 14:15:54 +00:00
|
|
|
struct sk_buff *in_skb, const struct nlmsghdr *nlh,
|
|
|
|
const struct inet_diag_req_v2 *req);
|
2011-12-09 06:23:18 +00:00
|
|
|
|
2015-12-16 03:30:02 +00:00
|
|
|
struct sock *inet_diag_find_one_icsk(struct net *net,
|
|
|
|
struct inet_hashinfo *hashinfo,
|
|
|
|
const struct inet_diag_req_v2 *req);
|
|
|
|
|
2011-12-09 06:22:44 +00:00
|
|
|
int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
|
2011-12-09 06:21:53 +00:00
|
|
|
|
2016-06-09 17:05:09 +00:00
|
|
|
void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk);
|
|
|
|
|
|
|
|
int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
|
|
|
|
struct inet_diag_msg *r, int ext,
|
2016-09-07 15:42:25 +00:00
|
|
|
struct user_namespace *user_ns, bool net_admin);
|
2016-06-09 17:05:09 +00:00
|
|
|
|
2005-08-12 12:27:49 +00:00
|
|
|
extern int inet_diag_register(const struct inet_diag_handler *handler);
|
|
|
|
extern void inet_diag_unregister(const struct inet_diag_handler *handler);
|
2005-08-12 15:51:49 +00:00
|
|
|
#endif /* _INET_DIAG_H_ */
|