sock_diag.h 1.1 KB
Newer Older
P
Pavel Emelyanov 已提交
1 2
#ifndef __SOCK_DIAG_H__
#define __SOCK_DIAG_H__
3

4
#include <linux/types.h>
5

6
#define SOCK_DIAG_BY_FAMILY 20
P
Pavel Emelyanov 已提交
7 8 9 10 11 12

struct sock_diag_req {
	__u8	sdiag_family;
	__u8	sdiag_protocol;
};

13 14 15 16 17 18 19 20 21 22 23 24
enum {
	SK_MEMINFO_RMEM_ALLOC,
	SK_MEMINFO_RCVBUF,
	SK_MEMINFO_WMEM_ALLOC,
	SK_MEMINFO_SNDBUF,
	SK_MEMINFO_FWD_ALLOC,
	SK_MEMINFO_WMEM_QUEUED,
	SK_MEMINFO_OPTMEM,

	SK_MEMINFO_VARS,
};

25 26 27
#ifdef __KERNEL__
struct sk_buff;
struct nlmsghdr;
28
struct sock;
29

P
Pavel Emelyanov 已提交
30 31 32 33 34
struct sock_diag_handler {
	__u8 family;
	int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
};

35 36
int sock_diag_register(const struct sock_diag_handler *h);
void sock_diag_unregister(const struct sock_diag_handler *h);
P
Pavel Emelyanov 已提交
37 38 39 40

void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));

41 42 43
int sock_diag_check_cookie(void *sk, __u32 *cookie);
void sock_diag_save_cookie(void *sk, __u32 *cookie);

44 45
int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);

P
Pavel Emelyanov 已提交
46
extern struct sock *sock_diag_nlsk;
47
#endif /* KERNEL */
P
Pavel Emelyanov 已提交
48
#endif