1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
Index: linux-2.6.17/include/linux/vserver/cacct_cmd.h
===================================================================
--- linux-2.6.17.orig/include/linux/vserver/cacct_cmd.h
+++ linux-2.6.17/include/linux/vserver/cacct_cmd.h
@@ -1,4 +1,34 @@
#ifndef _VX_CACCT_CMD_H
#define _VX_CACCT_CMD_H
+
+/* accounting status commands */
+
+#define VCMD_sock_stat VC_CMD(VSTAT, 5, 0)
+
+struct vcmd_sock_stat_v0 {
+ uint32_t field;
+ uint32_t pad0;
+ uint64_t count;
+ uint64_t total;
+};
+
+
+enum sock_stat_field {
+ SOCK_UNSPEC=0,
+ SOCK_UNIX,
+ SOCK_INET,
+ SOCK_INET6,
+ SOCK_PACKET,
+ SOCK_OTHER,
+};
+
+
+#ifdef __KERNEL__
+
+#include <linux/compiler.h>
+
+extern int vc_sock_stat(struct vx_info *, void __user *);
+
+#endif /* __KERNEL__ */
#endif /* _VX_CACCT_CMD_H */
Index: linux-2.6.17/include/linux/vserver/limit_cmd.h
===================================================================
--- linux-2.6.17.orig/include/linux/vserver/limit_cmd.h
+++ linux-2.6.17/include/linux/vserver/limit_cmd.h
@@ -22,6 +22,16 @@ struct vcmd_ctx_rlimit_mask_v0 {
uint32_t maximum;
};
+#define VCMD_rlimit_stat VC_CMD(VSTAT, 1, 0)
+
+struct vcmd_rlimit_stat_v0 {
+ uint32_t id;
+ uint32_t hits;
+ uint64_t value;
+ uint64_t minimum;
+ uint64_t maximum;
+};
+
#define CRLIM_UNSET (0ULL)
#define CRLIM_INFINITY (~0ULL)
#define CRLIM_KEEP (~1ULL)
@@ -46,6 +56,8 @@ extern int vc_get_rlimit(struct vx_info
extern int vc_set_rlimit(struct vx_info *, void __user *);
extern int vc_reset_minmax(struct vx_info *, void __user *);
+extern int vc_rlimit_stat(struct vx_info *, void __user *);
+
#ifdef CONFIG_IA32_EMULATION
extern int vc_get_rlimit_x32(struct vx_info *, void __user *);
Index: linux-2.6.17/include/linux/vserver/switch.h
===================================================================
--- linux-2.6.17.orig/include/linux/vserver/switch.h
+++ linux-2.6.17/include/linux/vserver/switch.h
@@ -34,7 +34,7 @@
DISK | | | | |DLIMIT | | |INODE | |
VFS | 32| 33| 34| 35| 36| 37| | 38| 39|
-------+-------+-------+-------+-------+-------+-------+ +-------+-------+
- OTHER | | | | | | | |VINFO | |
+ OTHER |VSTAT | | | | | | |VINFO | |
| 40| 41| 42| 43| 44| 45| | 46| 47|
=======+=======+=======+=======+=======+=======+=======+ +=======+=======+
SPECIAL|EVENT | | | |FLAGS | | | | |
@@ -66,6 +66,7 @@
#define VC_CAT_DLIMIT 36
#define VC_CAT_INODE 38
+#define VC_CAT_VSTAT 40
#define VC_CAT_VINFO 46
#define VC_CAT_EVENT 48
@@ -78,7 +79,7 @@
/* interface version */
-#define VCI_VERSION 0x00020101
+#define VCI_VERSION 0x00020102
#define VCI_LEGACY_VERSION 0x000100FF
/* query version */
|