diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2011-12-29 19:53:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-30 16:42:19 -0500 |
commit | 5d2e5f274f9e9a06fb934dd45260e2616a9992e6 (patch) | |
tree | 61ae9157e41b00a19f58518d58d0c739393cbccb /include/linux/sock_diag.h | |
parent | 288461e1546fa4162fa237eeed8ea09a16521dcd (diff) |
sock_diag: Introduce the meminfo nla core (v2)
Add a routine that dumps memory-related values of a socket.
It's made as an array to make it possible to add more stuff
here later without breaking compatibility.
Since v1: The SK_MEMINFO_ constants are in userspace
visible part of sock_diag.h, the rest is under __KERNEL__.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/sock_diag.h')
-rw-r--r-- | include/linux/sock_diag.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h index 66bc18ef4fa4..251729a47880 100644 --- a/include/linux/sock_diag.h +++ b/include/linux/sock_diag.h | |||
@@ -10,9 +10,22 @@ struct sock_diag_req { | |||
10 | __u8 sdiag_protocol; | 10 | __u8 sdiag_protocol; |
11 | }; | 11 | }; |
12 | 12 | ||
13 | enum { | ||
14 | SK_MEMINFO_RMEM_ALLOC, | ||
15 | SK_MEMINFO_RCVBUF, | ||
16 | SK_MEMINFO_WMEM_ALLOC, | ||
17 | SK_MEMINFO_SNDBUF, | ||
18 | SK_MEMINFO_FWD_ALLOC, | ||
19 | SK_MEMINFO_WMEM_QUEUED, | ||
20 | SK_MEMINFO_OPTMEM, | ||
21 | |||
22 | SK_MEMINFO_VARS, | ||
23 | }; | ||
24 | |||
13 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
14 | struct sk_buff; | 26 | struct sk_buff; |
15 | struct nlmsghdr; | 27 | struct nlmsghdr; |
28 | struct sock; | ||
16 | 29 | ||
17 | struct sock_diag_handler { | 30 | struct sock_diag_handler { |
18 | __u8 family; | 31 | __u8 family; |
@@ -28,6 +41,8 @@ void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlms | |||
28 | int sock_diag_check_cookie(void *sk, __u32 *cookie); | 41 | int sock_diag_check_cookie(void *sk, __u32 *cookie); |
29 | void sock_diag_save_cookie(void *sk, __u32 *cookie); | 42 | void sock_diag_save_cookie(void *sk, __u32 *cookie); |
30 | 43 | ||
44 | int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr); | ||
45 | |||
31 | extern struct sock *sock_diag_nlsk; | 46 | extern struct sock *sock_diag_nlsk; |
32 | #endif /* KERNEL */ | 47 | #endif /* KERNEL */ |
33 | #endif | 48 | #endif |