inet_diag.h 1.6 KB
Newer Older
1 2
#ifndef _INET_DIAG_H_
#define _INET_DIAG_H_ 1
L
Linus Torvalds 已提交
3

4
#include <uapi/linux/inet_diag.h>
5

6
struct net;
7 8
struct sock;
struct inet_hashinfo;
9
struct nlattr;
10 11
struct nlmsghdr;
struct sk_buff;
12
struct netlink_callback;
13 14

struct inet_diag_handler {
15 16 17 18 19 20 21 22 23 24 25 26 27
	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);
	__u16		idiag_type;
28
	__u16		idiag_info_size;
29 30
};

31 32
struct inet_connection_sock;
int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
33 34 35 36
		      struct sk_buff *skb, const struct inet_diag_req_v2 *req,
		      struct user_namespace *user_ns,
		      u32 pid, u32 seq, u16 nlmsg_flags,
		      const struct nlmsghdr *unlh);
37
void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
38 39 40
			 struct netlink_callback *cb,
			 const struct inet_diag_req_v2 *r,
			 struct nlattr *bc);
41
int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
42 43
			    struct sk_buff *in_skb, const struct nlmsghdr *nlh,
			    const struct inet_diag_req_v2 *req);
44

45 46 47 48
struct sock *inet_diag_find_one_icsk(struct net *net,
				     struct inet_hashinfo *hashinfo,
				     const struct inet_diag_req_v2 *req);

49
int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
50

51 52
extern int  inet_diag_register(const struct inet_diag_handler *handler);
extern void inet_diag_unregister(const struct inet_diag_handler *handler);
53
#endif /* _INET_DIAG_H_ */