-+vs_v4:
-+ if (!sk1_rcv_saddr && !sk2_rcv_saddr)
-+ return nx_v4_addr_conflict(sk1->sk_nx_info, sk2->sk_nx_info);
-+ if (!sk2_rcv_saddr)
-+ return v4_addr_in_nx_info(sk1->sk_nx_info, sk2_rcv_saddr, -1);
-+ if (!sk1_rcv_saddr)
-+ return v4_addr_in_nx_info(sk2->sk_nx_info, sk1_rcv_saddr, -1);
-+ return 1;
-+vs:
-+ if (addr_type2 == IPV6_ADDR_ANY && addr_type == IPV6_ADDR_ANY)
-+ return nx_v6_addr_conflict(sk1->sk_nx_info, sk2->sk_nx_info);
-+ else if (addr_type2 == IPV6_ADDR_ANY)
-+ return v6_addr_in_nx_info(sk2->sk_nx_info, sk1_rcv_saddr6, -1);
-+ else if (addr_type == IPV6_ADDR_ANY) {
-+ if (addr_type2 == IPV6_ADDR_MAPPED)
-+ return nx_v4_addr_conflict(sk1->sk_nx_info, sk2->sk_nx_info);
-+ else
-+ return v6_addr_in_nx_info(sk1->sk_nx_info, sk2_rcv_saddr6, -1);
-+ }
-+ return 1;
- }
-
- static unsigned int udp6_portaddr_hash(struct net *net,
-@@ -144,6 +170,10 @@ static inline int compute_score(struct s
- if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
- return -1;
- score++;
-+ } else {
-+ /* block non nx_info ips */
-+ if (!v6_addr_in_nx_info(sk->sk_nx_info, daddr, -1))
-+ return -1;
- }
- if (!ipv6_addr_any(&np->daddr)) {
- if (!ipv6_addr_equal(&np->daddr, saddr))
-diff -NurpP --minimal linux-3.7/net/ipv6/xfrm6_policy.c linux-3.7-vs2.3.5.1/net/ipv6/xfrm6_policy.c
---- linux-3.7/net/ipv6/xfrm6_policy.c 2012-10-04 13:27:50.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/ipv6/xfrm6_policy.c 2012-12-11 15:56:33.000000000 +0000
-@@ -63,7 +63,7 @@ static int xfrm6_get_saddr(struct net *n
- dev = ip6_dst_idev(dst)->dev;
- ipv6_dev_get_saddr(dev_net(dev), dev,
- (struct in6_addr *)&daddr->a6, 0,
-- (struct in6_addr *)&saddr->a6);
-+ (struct in6_addr *)&saddr->a6, NULL);
- dst_release(dst);
- return 0;
- }
-diff -NurpP --minimal linux-3.7/net/netfilter/ipvs/ip_vs_xmit.c linux-3.7-vs2.3.5.1/net/netfilter/ipvs/ip_vs_xmit.c
---- linux-3.7/net/netfilter/ipvs/ip_vs_xmit.c 2012-12-11 15:47:55.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/netfilter/ipvs/ip_vs_xmit.c 2012-12-11 15:56:33.000000000 +0000
-@@ -273,7 +273,7 @@ __ip_vs_route_output_v6(struct net *net,
- return dst;
- if (ipv6_addr_any(&fl6.saddr) &&
- ipv6_dev_get_saddr(net, ip6_dst_idev(dst)->dev,
-- &fl6.daddr, 0, &fl6.saddr) < 0)
-+ &fl6.daddr, 0, &fl6.saddr, NULL) < 0)
- goto out_err;
- if (do_xfrm) {
- dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
-diff -NurpP --minimal linux-3.7/net/netlink/af_netlink.c linux-3.7-vs2.3.5.1/net/netlink/af_netlink.c
---- linux-3.7/net/netlink/af_netlink.c 2012-12-11 15:47:56.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/netlink/af_netlink.c 2012-12-11 15:56:33.000000000 +0000
-@@ -55,6 +55,9 @@
- #include <linux/types.h>
- #include <linux/audit.h>
- #include <linux/mutex.h>
-+#include <linux/vs_context.h>
-+#include <linux/vs_network.h>
-+#include <linux/vs_limit.h>
-
- #include <net/net_namespace.h>
- #include <net/sock.h>
-@@ -1981,6 +1984,8 @@ static struct sock *netlink_seq_socket_i
- sk_for_each(s, node, &hash->table[j]) {
- if (sock_net(s) != seq_file_net(seq))
- continue;
-+ if (!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT))
-+ continue;
- if (off == pos) {
- iter->link = i;
- iter->hash_idx = j;
-@@ -2015,7 +2020,8 @@ static void *netlink_seq_next(struct seq
- s = v;
- do {
- s = sk_next(s);
-- } while (s && sock_net(s) != seq_file_net(seq));
-+ } while (s && (sock_net(s) != seq_file_net(seq) ||
-+ !nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT)));
- if (s)
- return s;
-
-@@ -2027,7 +2033,8 @@ static void *netlink_seq_next(struct seq
-
- for (; j <= hash->mask; j++) {
- s = sk_head(&hash->table[j]);
-- while (s && sock_net(s) != seq_file_net(seq))
-+ while (s && (sock_net(s) != seq_file_net(seq) ||
-+ !nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT)))
- s = sk_next(s);
- if (s) {
- iter->link = i;
-diff -NurpP --minimal linux-3.7/net/socket.c linux-3.7-vs2.3.5.1/net/socket.c
---- linux-3.7/net/socket.c 2012-12-11 15:47:57.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/socket.c 2012-12-11 15:56:33.000000000 +0000
-@@ -99,6 +99,10 @@
-
- #include <net/sock.h>
- #include <linux/netfilter.h>
-+#include <linux/vs_base.h>
-+#include <linux/vs_socket.h>
-+#include <linux/vs_inet.h>
-+#include <linux/vs_inet6.h>
-
- #include <linux/if_tun.h>
- #include <linux/ipv6_route.h>
-@@ -619,6 +623,7 @@ static inline int __sock_sendmsg_nosec(s
- struct msghdr *msg, size_t size)
- {
- struct sock_iocb *si = kiocb_to_siocb(iocb);
-+ size_t len;
-
- sock_update_classid(sock->sk);
-
-@@ -627,7 +632,22 @@ static inline int __sock_sendmsg_nosec(s
- si->msg = msg;
- si->size = size;
-
-- return sock->ops->sendmsg(iocb, sock, msg, size);
-+ len = sock->ops->sendmsg(iocb, sock, msg, size);
-+ if (sock->sk) {
-+ if (len == size)
-+ vx_sock_send(sock->sk, size);
-+ else
-+ vx_sock_fail(sock->sk, size);
-+ }
-+ vxdprintk(VXD_CBIT(net, 7),
-+ "__sock_sendmsg: %p[%p,%p,%p;%d/%d]:%d/%zu",
-+ sock, sock->sk,
-+ (sock->sk)?sock->sk->sk_nx_info:0,
-+ (sock->sk)?sock->sk->sk_vx_info:0,
-+ (sock->sk)?sock->sk->sk_xid:0,
-+ (sock->sk)?sock->sk->sk_nid:0,
-+ (unsigned int)size, len);
-+ return len;
- }
-
- static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock,
-@@ -783,6 +803,7 @@ static inline int __sock_recvmsg_nosec(s
- struct msghdr *msg, size_t size, int flags)
- {
- struct sock_iocb *si = kiocb_to_siocb(iocb);
-+ int len;
-
- sock_update_classid(sock->sk);
-
-@@ -792,7 +813,18 @@ static inline int __sock_recvmsg_nosec(s
- si->size = size;
- si->flags = flags;
-
-- return sock->ops->recvmsg(iocb, sock, msg, size, flags);
-+ len = sock->ops->recvmsg(iocb, sock, msg, size, flags);
-+ if ((len >= 0) && sock->sk)
-+ vx_sock_recv(sock->sk, len);
-+ vxdprintk(VXD_CBIT(net, 7),
-+ "__sock_recvmsg: %p[%p,%p,%p;%d/%d]:%d/%d",
-+ sock, sock->sk,
-+ (sock->sk)?sock->sk->sk_nx_info:0,
-+ (sock->sk)?sock->sk->sk_vx_info:0,
-+ (sock->sk)?sock->sk->sk_xid:0,
-+ (sock->sk)?sock->sk->sk_nid:0,
-+ (unsigned int)size, len);
-+ return len;
- }
-
- static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock,
-@@ -1277,6 +1309,13 @@ int __sock_create(struct net *net, int f
- if (type < 0 || type >= SOCK_MAX)
- return -EINVAL;
-
-+ if (!nx_check(0, VS_ADMIN)) {
-+ if (family == PF_INET && !current_nx_info_has_v4())
-+ return -EAFNOSUPPORT;
-+ if (family == PF_INET6 && !current_nx_info_has_v6())
-+ return -EAFNOSUPPORT;
-+ }
-+
- /* Compatibility.
-
- This uglymoron is moved from INET layer to here to avoid
-@@ -1411,6 +1450,7 @@ SYSCALL_DEFINE3(socket, int, family, int
- if (retval < 0)
- goto out;
-
-+ set_bit(SOCK_USER_SOCKET, &sock->flags);
- retval = sock_map_fd(sock, flags & (O_CLOEXEC | O_NONBLOCK));
- if (retval < 0)
- goto out_release;
-@@ -1452,10 +1492,12 @@ SYSCALL_DEFINE4(socketpair, int, family,
- err = sock_create(family, type, protocol, &sock1);
- if (err < 0)
- goto out;
-+ set_bit(SOCK_USER_SOCKET, &sock1->flags);
-
- err = sock_create(family, type, protocol, &sock2);
- if (err < 0)
- goto out_release_1;
-+ set_bit(SOCK_USER_SOCKET, &sock2->flags);
-
- err = sock1->ops->socketpair(sock1, sock2);
- if (err < 0)
-diff -NurpP --minimal linux-3.7/net/sunrpc/auth.c linux-3.7-vs2.3.5.1/net/sunrpc/auth.c
---- linux-3.7/net/sunrpc/auth.c 2012-10-04 13:27:51.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/sunrpc/auth.c 2012-12-11 15:56:33.000000000 +0000
-@@ -15,6 +15,7 @@
- #include <linux/sunrpc/clnt.h>
- #include <linux/sunrpc/gss_api.h>
- #include <linux/spinlock.h>
-+#include <linux/vs_tag.h>
-
- #ifdef RPC_DEBUG
- # define RPCDBG_FACILITY RPCDBG_AUTH
-@@ -481,6 +482,7 @@ rpcauth_lookupcred(struct rpc_auth *auth
- memset(&acred, 0, sizeof(acred));
- acred.uid = cred->fsuid;
- acred.gid = cred->fsgid;
-+ acred.tag = dx_current_tag();
- acred.group_info = get_group_info(((struct cred *)cred)->group_info);
-
- ret = auth->au_ops->lookup_cred(auth, &acred, flags);
-@@ -521,6 +523,7 @@ rpcauth_bind_root_cred(struct rpc_task *
- struct auth_cred acred = {
- .uid = 0,
- .gid = 0,
-+ .tag = dx_current_tag(),
- };
-
- dprintk("RPC: %5u looking up %s cred\n",
-diff -NurpP --minimal linux-3.7/net/sunrpc/auth_unix.c linux-3.7-vs2.3.5.1/net/sunrpc/auth_unix.c
---- linux-3.7/net/sunrpc/auth_unix.c 2012-07-22 21:39:49.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/sunrpc/auth_unix.c 2012-12-11 15:56:33.000000000 +0000
-@@ -13,11 +13,13 @@
- #include <linux/sunrpc/clnt.h>
- #include <linux/sunrpc/auth.h>
- #include <linux/user_namespace.h>
-+#include <linux/vs_tag.h>
-
- #define NFS_NGROUPS 16
-
- struct unx_cred {
- struct rpc_cred uc_base;
-+ tag_t uc_tag;
- gid_t uc_gid;
- gid_t uc_gids[NFS_NGROUPS];
- };
-@@ -79,6 +81,7 @@ unx_create_cred(struct rpc_auth *auth, s
- groups = NFS_NGROUPS;
-
- cred->uc_gid = acred->gid;
-+ cred->uc_tag = acred->tag;
- for (i = 0; i < groups; i++) {
- gid_t gid;
- gid = from_kgid(&init_user_ns, GROUP_AT(acred->group_info, i));
-@@ -123,7 +126,9 @@ unx_match(struct auth_cred *acred, struc
- unsigned int i;
-
-
-- if (cred->uc_uid != acred->uid || cred->uc_gid != acred->gid)
-+ if (cred->uc_uid != acred->uid ||
-+ cred->uc_gid != acred->gid ||
-+ cred->uc_tag != acred->tag)
- return 0;
-
- if (acred->group_info != NULL)
-@@ -152,7 +157,7 @@ unx_marshal(struct rpc_task *task, __be3
- struct rpc_clnt *clnt = task->tk_client;
- struct unx_cred *cred = container_of(task->tk_rqstp->rq_cred, struct unx_cred, uc_base);
- __be32 *base, *hold;
-- int i;
-+ int i, tag;
-
- *p++ = htonl(RPC_AUTH_UNIX);
- base = p++;
-@@ -162,9 +167,12 @@ unx_marshal(struct rpc_task *task, __be3
- * Copy the UTS nodename captured when the client was created.
- */
- p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen);
-+ tag = task->tk_client->cl_tag;
-
-- *p++ = htonl((u32) cred->uc_uid);
-- *p++ = htonl((u32) cred->uc_gid);
-+ *p++ = htonl((u32) TAGINO_UID(tag,
-+ cred->uc_uid, cred->uc_tag));
-+ *p++ = htonl((u32) TAGINO_GID(tag,
-+ cred->uc_gid, cred->uc_tag));
- hold = p++;
- for (i = 0; i < 16 && cred->uc_gids[i] != (gid_t) NOGROUP; i++)
- *p++ = htonl((u32) cred->uc_gids[i]);
-diff -NurpP --minimal linux-3.7/net/sunrpc/clnt.c linux-3.7-vs2.3.5.1/net/sunrpc/clnt.c
---- linux-3.7/net/sunrpc/clnt.c 2012-12-11 15:47:57.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/sunrpc/clnt.c 2012-12-11 15:56:33.000000000 +0000
-@@ -31,6 +31,7 @@
- #include <linux/in6.h>
- #include <linux/un.h>
- #include <linux/rcupdate.h>
-+#include <linux/vs_cvirt.h>
-
- #include <linux/sunrpc/clnt.h>
- #include <linux/sunrpc/rpc_pipe_fs.h>
-@@ -481,6 +482,9 @@ struct rpc_clnt *rpc_create(struct rpc_c
- if (!(args->flags & RPC_CLNT_CREATE_QUIET))
- clnt->cl_chatty = 1;
-
-+ /* TODO: handle RPC_CLNT_CREATE_TAGGED
-+ if (args->flags & RPC_CLNT_CREATE_TAGGED)
-+ clnt->cl_tag = 1; */
- return clnt;
- }
- EXPORT_SYMBOL_GPL(rpc_create);
-diff -NurpP --minimal linux-3.7/net/unix/af_unix.c linux-3.7-vs2.3.5.1/net/unix/af_unix.c
---- linux-3.7/net/unix/af_unix.c 2012-12-11 15:47:57.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/net/unix/af_unix.c 2012-12-11 15:56:33.000000000 +0000
-@@ -114,6 +114,8 @@
- #include <linux/mount.h>
- #include <net/checksum.h>
- #include <linux/security.h>
-+#include <linux/vs_context.h>
-+#include <linux/vs_limit.h>
-
- struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE];
- EXPORT_SYMBOL_GPL(unix_socket_table);
-@@ -271,6 +273,8 @@ static struct sock *__unix_find_socket_b
- if (!net_eq(sock_net(s), net))
- continue;
-
-+ if (!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT))
-+ continue;
- if (u->addr->len == len &&
- !memcmp(u->addr->name, sunname, len))
- goto found;
-@@ -2259,6 +2263,8 @@ static struct sock *unix_from_bucket(str
- for (sk = sk_head(&unix_socket_table[bucket]); sk; sk = sk_next(sk)) {
- if (sock_net(sk) != seq_file_net(seq))
- continue;
-+ if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
-+ continue;
- if (++count == offset)
- break;
- }
-@@ -2276,6 +2282,8 @@ static struct sock *unix_next_socket(str
- sk = sk_next(sk);
- if (!sk)
- goto next_bucket;
-+ if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
-+ continue;
- if (sock_net(sk) == seq_file_net(seq))
- return sk;
- }
-diff -NurpP --minimal linux-3.7/scripts/checksyscalls.sh linux-3.7-vs2.3.5.1/scripts/checksyscalls.sh
---- linux-3.7/scripts/checksyscalls.sh 2012-10-04 13:27:51.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/scripts/checksyscalls.sh 2012-12-11 15:56:33.000000000 +0000
-@@ -193,7 +193,6 @@ cat << EOF
- #define __IGNORE_afs_syscall
- #define __IGNORE_getpmsg
- #define __IGNORE_putpmsg
--#define __IGNORE_vserver
- EOF
- }
-
-diff -NurpP --minimal linux-3.7/security/commoncap.c linux-3.7-vs2.3.5.1/security/commoncap.c
---- linux-3.7/security/commoncap.c 2012-07-22 21:39:51.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/security/commoncap.c 2012-12-11 15:56:33.000000000 +0000
-@@ -76,14 +76,20 @@ int cap_netlink_send(struct sock *sk, st
- int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,
- int cap, int audit)
- {
-+ struct vx_info *vxi = current_vx_info(); /* FIXME: get vxi from cred? */
-+
- for (;;) {
- /* The owner of the user namespace has all caps. */
- if (targ_ns != &init_user_ns && uid_eq(targ_ns->owner, cred->euid))
- return 0;
-
- /* Do we have the necessary capabilities? */
-- if (targ_ns == cred->user_ns)
-- return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM;
-+ if (targ_ns == cred->user_ns) {
-+ if (vx_info_flags(vxi, VXF_STATE_SETUP, 0) &&
-+ cap_raised(cred->cap_effective, cap))
-+ return 0;
-+ return vx_cap_raised(vxi, cred->cap_effective, cap) ? 0 : -EPERM;
-+ }
-
- /* Have we tried all of the parent namespaces? */
- if (targ_ns == &init_user_ns)
-@@ -619,7 +625,7 @@ int cap_inode_setxattr(struct dentry *de
-
- if (!strncmp(name, XATTR_SECURITY_PREFIX,
- sizeof(XATTR_SECURITY_PREFIX) - 1) &&
-- !capable(CAP_SYS_ADMIN))
-+ !vx_capable(CAP_SYS_ADMIN, VXC_FS_SECURITY))
- return -EPERM;
- return 0;
- }
-@@ -645,7 +651,7 @@ int cap_inode_removexattr(struct dentry
-
- if (!strncmp(name, XATTR_SECURITY_PREFIX,
- sizeof(XATTR_SECURITY_PREFIX) - 1) &&
-- !capable(CAP_SYS_ADMIN))
-+ !vx_capable(CAP_SYS_ADMIN, VXC_FS_SECURITY))
- return -EPERM;
- return 0;
- }
-diff -NurpP --minimal linux-3.7/security/selinux/hooks.c linux-3.7-vs2.3.5.1/security/selinux/hooks.c
---- linux-3.7/security/selinux/hooks.c 2012-12-11 15:48:01.000000000 +0000
-+++ linux-3.7-vs2.3.5.1/security/selinux/hooks.c 2012-12-11 15:56:33.000000000 +0000
-@@ -66,7 +66,6 @@
- #include <linux/dccp.h>
- #include <linux/quota.h>
- #include <linux/un.h> /* for Unix socket types */
--#include <net/af_unix.h> /* for Unix socket types */
- #include <linux/parser.h>
- #include <linux/nfs_mount.h>
- #include <net/ipv6.h>
-diff -NurpP linux-3.7-vs2.3.5.1/kernel/vserver/network.c linux-3.7-vs2.3.5.1.1/kernel/vserver/network.c
---- linux-3.7-vs2.3.5.1/kernel/vserver/network.c 2012-12-11 15:56:33.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.1/kernel/vserver/network.c 2012-12-13 13:48:35.000000000 +0000
-@@ -162,6 +163,9 @@ static void __dealloc_nx_info(struct nx_
- BUG_ON(atomic_read(&nxi->nx_tasks));
-
- __dealloc_nx_addr_v4_all(nxi->v4.next);
-+#ifdef CONFIG_IPV6
-+ __dealloc_nx_addr_v6_all(nxi->v6.next);
-+#endif
-
- nxi->nx_state |= NXS_RELEASED;
- kfree(nxi);
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.2/net/ipv6/netfilter/ip6t_MASQUERADE.c linux-3.7-vs2.3.5.1.3/net/ipv6/netfilter/ip6t_MASQUERADE.c
---- linux-3.7-vs2.3.5.1.2/net/ipv6/netfilter/ip6t_MASQUERADE.c 2012-12-11 15:47:54.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3/net/ipv6/netfilter/ip6t_MASQUERADE.c 2012-12-13 20:26:20.000000000 +0000
-@@ -34,7 +34,7 @@ masquerade_tg6(struct sk_buff *skb, cons
- ctinfo == IP_CT_RELATED_REPLY));
-
- if (ipv6_dev_get_saddr(dev_net(par->out), par->out,
-- &ipv6_hdr(skb)->daddr, 0, &src) < 0)
-+ &ipv6_hdr(skb)->daddr, 0, &src, NULL) < 0)
- return NF_DROP;
-
- nfct_nat(ct)->masq_index = par->out->ifindex;
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/Kbuild linux-3.7-vs2.3.5.1.3-uapi/include/linux/Kbuild
---- linux-3.7-vs2.3.5.1.3/include/linux/Kbuild 2012-12-11 16:09:38.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/Kbuild 2012-12-13 22:09:10.000000000 +0000
-@@ -3,4 +3,3 @@ header-y += hdlc/
- header-y += hsi/
- header-y += raid/
- header-y += usb/
--header-y += vserver/
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/Kbuild linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/Kbuild
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/Kbuild 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/Kbuild 1970-01-01 00:00:00.000000000 +0000
-@@ -1,8 +0,0 @@
--
--header-y += context_cmd.h network_cmd.h space_cmd.h \
-- cacct_cmd.h cvirt_cmd.h limit_cmd.h dlimit_cmd.h \
-- inode_cmd.h tag_cmd.h sched_cmd.h signal_cmd.h \
-- debug_cmd.h device_cmd.h
--
--header-y += switch.h network.h monitor.h inode.h device.h
--
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/base.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/base.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/base.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/base.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_BASE_H
--#define _VX_BASE_H
-+#ifndef _VSERVER_BASE_H
-+#define _VSERVER_BASE_H
-
-
- /* context state changes */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_CACCT_H
--#define _VX_CACCT_H
-+#ifndef _VSERVER_CACCT_H
-+#define _VSERVER_CACCT_H
-
-
- enum sock_acc_field {
-@@ -12,4 +12,4 @@ enum sock_acc_field {
- VXA_SOCK_SIZE /* array size */
- };
-
--#endif /* _VX_CACCT_H */
-+#endif /* _VSERVER_CACCT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,23 +1,10 @@
--#ifndef _VX_CACCT_CMD_H
--#define _VX_CACCT_CMD_H
--
--
--/* virtual host info name commands */
--
--#define VCMD_sock_stat VC_CMD(VSTAT, 5, 0)
--
--struct vcmd_sock_stat_v0 {
-- uint32_t field;
-- uint32_t count[3];
-- uint64_t total[3];
--};
--
-+#ifndef _VSERVER_CACCT_CMD_H
-+#define _VSERVER_CACCT_CMD_H
-
--#ifdef __KERNEL__
-
- #include <linux/compiler.h>
-+#include <uapi/vserver/cacct_cmd.h>
-
- extern int vc_sock_stat(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_CACCT_CMD_H */
-+#endif /* _VSERVER_CACCT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct_def.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct_def.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct_def.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct_def.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_CACCT_DEF_H
--#define _VX_CACCT_DEF_H
-+#ifndef _VSERVER_CACCT_DEF_H
-+#define _VSERVER_CACCT_DEF_H
-
- #include <asm/atomic.h>
- #include <linux/vserver/cacct.h>
-@@ -40,4 +40,4 @@ static inline void __dump_vx_cacct(struc
-
- #endif
-
--#endif /* _VX_CACCT_DEF_H */
-+#endif /* _VSERVER_CACCT_DEF_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct_int.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct_int.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/cacct_int.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cacct_int.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,8 +1,5 @@
--#ifndef _VX_CACCT_INT_H
--#define _VX_CACCT_INT_H
--
--
--#ifdef __KERNEL__
-+#ifndef _VSERVER_CACCT_INT_H
-+#define _VSERVER_CACCT_INT_H
-
- static inline
- unsigned long vx_sock_count(struct _vx_cacct *cacct, int type, int pos)
-@@ -17,5 +14,4 @@ unsigned long vx_sock_total(struct _vx_c
- return atomic_long_read(&cacct->sock[type][pos].total);
- }
-
--#endif /* __KERNEL__ */
--#endif /* _VX_CACCT_INT_H */
-+#endif /* _VSERVER_CACCT_INT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/check.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/check.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/check.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/check.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VS_CHECK_H
--#define _VS_CHECK_H
-+#ifndef _VSERVER_CHECK_H
-+#define _VSERVER_CHECK_H
-
-
- #define MAX_S_CONTEXT 65535 /* Arbitrary limit */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/context.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/context.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/context.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/context.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,88 +1,11 @@
--#ifndef _VX_CONTEXT_H
--#define _VX_CONTEXT_H
--
--#include <linux/types.h>
--#include <linux/capability.h>
--
--
--/* context flags */
--
--#define VXF_INFO_SCHED 0x00000002
--#define VXF_INFO_NPROC 0x00000004
--#define VXF_INFO_PRIVATE 0x00000008
--
--#define VXF_INFO_INIT 0x00000010
--#define VXF_INFO_HIDE 0x00000020
--#define VXF_INFO_ULIMIT 0x00000040
--#define VXF_INFO_NSPACE 0x00000080
--
--#define VXF_SCHED_HARD 0x00000100
--#define VXF_SCHED_PRIO 0x00000200
--#define VXF_SCHED_PAUSE 0x00000400
--
--#define VXF_VIRT_MEM 0x00010000
--#define VXF_VIRT_UPTIME 0x00020000
--#define VXF_VIRT_CPU 0x00040000
--#define VXF_VIRT_LOAD 0x00080000
--#define VXF_VIRT_TIME 0x00100000
--
--#define VXF_HIDE_MOUNT 0x01000000
--/* was VXF_HIDE_NETIF 0x02000000 */
--#define VXF_HIDE_VINFO 0x04000000
--
--#define VXF_STATE_SETUP (1ULL << 32)
--#define VXF_STATE_INIT (1ULL << 33)
--#define VXF_STATE_ADMIN (1ULL << 34)
--
--#define VXF_SC_HELPER (1ULL << 36)
--#define VXF_REBOOT_KILL (1ULL << 37)
--#define VXF_PERSISTENT (1ULL << 38)
--
--#define VXF_FORK_RSS (1ULL << 48)
--#define VXF_PROLIFIC (1ULL << 49)
--
--#define VXF_IGNEG_NICE (1ULL << 52)
--
--#define VXF_ONE_TIME (0x0007ULL << 32)
--
--#define VXF_INIT_SET (VXF_STATE_SETUP | VXF_STATE_INIT | VXF_STATE_ADMIN)
--
--
--/* context migration */
--
--#define VXM_SET_INIT 0x00000001
--#define VXM_SET_REAPER 0x00000002
--
--/* context caps */
--
--#define VXC_SET_UTSNAME 0x00000001
--#define VXC_SET_RLIMIT 0x00000002
--#define VXC_FS_SECURITY 0x00000004
--#define VXC_FS_TRUSTED 0x00000008
--#define VXC_TIOCSTI 0x00000010
--
--/* was VXC_RAW_ICMP 0x00000100 */
--#define VXC_SYSLOG 0x00001000
--#define VXC_OOM_ADJUST 0x00002000
--#define VXC_AUDIT_CONTROL 0x00004000
--
--#define VXC_SECURE_MOUNT 0x00010000
--#define VXC_SECURE_REMOUNT 0x00020000
--#define VXC_BINARY_MOUNT 0x00040000
--
--#define VXC_QUOTA_CTL 0x00100000
--#define VXC_ADMIN_MAPPER 0x00200000
--#define VXC_ADMIN_CLOOP 0x00400000
--
--#define VXC_KTHREAD 0x01000000
--#define VXC_NAMESPACE 0x02000000
--
-+#ifndef _VSERVER_CONTEXT_H
-+#define _VSERVER_CONTEXT_H
-
--#ifdef __KERNEL__
-
- #include <linux/list.h>
- #include <linux/spinlock.h>
- #include <linux/rcupdate.h>
-+#include <uapi/vserver/context.h>
-
- #include "limit_def.h"
- #include "sched_def.h"
-@@ -184,5 +107,4 @@ extern int vx_migrate_task(struct task_s
- extern long vs_state_change(struct vx_info *, unsigned int);
-
-
--#endif /* __KERNEL__ */
--#endif /* _VX_CONTEXT_H */
-+#endif /* _VSERVER_CONTEXT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/context_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/context_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/context_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/context_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,162 +1,33 @@
--#ifndef _VX_CONTEXT_CMD_H
--#define _VX_CONTEXT_CMD_H
--
--
--/* vinfo commands */
-+#ifndef _VSERVER_CONTEXT_CMD_H
-+#define _VSERVER_CONTEXT_CMD_H
-
--#define VCMD_task_xid VC_CMD(VINFO, 1, 0)
-+#include <uapi/vserver/context_cmd.h>
-
--#ifdef __KERNEL__
- extern int vc_task_xid(uint32_t);
-
--#endif /* __KERNEL__ */
--
--#define VCMD_vx_info VC_CMD(VINFO, 5, 0)
--
--struct vcmd_vx_info_v0 {
-- uint32_t xid;
-- uint32_t initpid;
-- /* more to come */
--};
--
--#ifdef __KERNEL__
- extern int vc_vx_info(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--#define VCMD_ctx_stat VC_CMD(VSTAT, 0, 0)
--
--struct vcmd_ctx_stat_v0 {
-- uint32_t usecnt;
-- uint32_t tasks;
-- /* more to come */
--};
--
--#ifdef __KERNEL__
- extern int vc_ctx_stat(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--/* context commands */
--
--#define VCMD_ctx_create_v0 VC_CMD(VPROC, 1, 0)
--#define VCMD_ctx_create VC_CMD(VPROC, 1, 1)
--
--struct vcmd_ctx_create {
-- uint64_t flagword;
--};
--
--#define VCMD_ctx_migrate_v0 VC_CMD(PROCMIG, 1, 0)
--#define VCMD_ctx_migrate VC_CMD(PROCMIG, 1, 1)
--
--struct vcmd_ctx_migrate {
-- uint64_t flagword;
--};
--
--#ifdef __KERNEL__
- extern int vc_ctx_create(uint32_t, void __user *);
- extern int vc_ctx_migrate(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* flag commands */
--
--#define VCMD_get_cflags VC_CMD(FLAGS, 1, 0)
--#define VCMD_set_cflags VC_CMD(FLAGS, 2, 0)
--
--struct vcmd_ctx_flags_v0 {
-- uint64_t flagword;
-- uint64_t mask;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_cflags(struct vx_info *, void __user *);
- extern int vc_set_cflags(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* context caps commands */
--
--#define VCMD_get_ccaps VC_CMD(FLAGS, 3, 1)
--#define VCMD_set_ccaps VC_CMD(FLAGS, 4, 1)
--
--struct vcmd_ctx_caps_v1 {
-- uint64_t ccaps;
-- uint64_t cmask;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_ccaps(struct vx_info *, void __user *);
- extern int vc_set_ccaps(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* bcaps commands */
--
--#define VCMD_get_bcaps VC_CMD(FLAGS, 9, 0)
--#define VCMD_set_bcaps VC_CMD(FLAGS, 10, 0)
--
--struct vcmd_bcaps {
-- uint64_t bcaps;
-- uint64_t bmask;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_bcaps(struct vx_info *, void __user *);
- extern int vc_set_bcaps(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* umask commands */
--
--#define VCMD_get_umask VC_CMD(FLAGS, 13, 0)
--#define VCMD_set_umask VC_CMD(FLAGS, 14, 0)
--
--struct vcmd_umask {
-- uint64_t umask;
-- uint64_t mask;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_umask(struct vx_info *, void __user *);
- extern int vc_set_umask(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* wmask commands */
--
--#define VCMD_get_wmask VC_CMD(FLAGS, 15, 0)
--#define VCMD_set_wmask VC_CMD(FLAGS, 16, 0)
--
--struct vcmd_wmask {
-- uint64_t wmask;
-- uint64_t mask;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_wmask(struct vx_info *, void __user *);
- extern int vc_set_wmask(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* OOM badness */
--
--#define VCMD_get_badness VC_CMD(MEMCTRL, 5, 0)
--#define VCMD_set_badness VC_CMD(MEMCTRL, 6, 0)
--
--struct vcmd_badness_v0 {
-- int64_t bias;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_badness(struct vx_info *, void __user *);
- extern int vc_set_badness(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_CONTEXT_CMD_H */
-+#endif /* _VSERVER_CONTEXT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/cvirt.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cvirt.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/cvirt.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cvirt.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,8 +1,5 @@
--#ifndef _VX_CVIRT_H
--#define _VX_CVIRT_H
--
--
--#ifdef __KERNEL__
-+#ifndef _VSERVER_CVIRT_H
-+#define _VSERVER_CVIRT_H
-
- struct timespec;
-
-@@ -18,5 +15,4 @@ void vx_update_load(struct vx_info *);
-
- int vx_do_syslog(int, char __user *, int);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_CVIRT_H */
-+#endif /* _VSERVER_CVIRT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/cvirt_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cvirt_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/cvirt_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cvirt_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,53 +1,13 @@
--#ifndef _VX_CVIRT_CMD_H
--#define _VX_CVIRT_CMD_H
--
--
--/* virtual host info name commands */
--
--#define VCMD_set_vhi_name VC_CMD(VHOST, 1, 0)
--#define VCMD_get_vhi_name VC_CMD(VHOST, 2, 0)
--
--struct vcmd_vhi_name_v0 {
-- uint32_t field;
-- char name[65];
--};
--
--
--enum vhi_name_field {
-- VHIN_CONTEXT = 0,
-- VHIN_SYSNAME,
-- VHIN_NODENAME,
-- VHIN_RELEASE,
-- VHIN_VERSION,
-- VHIN_MACHINE,
-- VHIN_DOMAINNAME,
--};
--
-+#ifndef _VSERVER_CVIRT_CMD_H
-+#define _VSERVER_CVIRT_CMD_H
-
--#ifdef __KERNEL__
-
- #include <linux/compiler.h>
-+#include <uapi/vserver/cvirt_cmd.h>
-
- extern int vc_set_vhi_name(struct vx_info *, void __user *);
- extern int vc_get_vhi_name(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--#define VCMD_virt_stat VC_CMD(VSTAT, 3, 0)
--
--struct vcmd_virt_stat_v0 {
-- uint64_t offset;
-- uint64_t uptime;
-- uint32_t nr_threads;
-- uint32_t nr_running;
-- uint32_t nr_uninterruptible;
-- uint32_t nr_onhold;
-- uint32_t nr_forks;
-- uint32_t load[3];
--};
--
--#ifdef __KERNEL__
- extern int vc_virt_stat(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_CVIRT_CMD_H */
-+#endif /* _VSERVER_CVIRT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/cvirt_def.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cvirt_def.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/cvirt_def.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/cvirt_def.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_CVIRT_DEF_H
--#define _VX_CVIRT_DEF_H
-+#ifndef _VSERVER_CVIRT_DEF_H
-+#define _VSERVER_CVIRT_DEF_H
-
- #include <linux/jiffies.h>
- #include <linux/spinlock.h>
-@@ -77,4 +77,4 @@ static inline void __dump_vx_cvirt(struc
-
- #endif
-
--#endif /* _VX_CVIRT_DEF_H */
-+#endif /* _VSERVER_CVIRT_DEF_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/debug.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/debug.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/debug.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/debug.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_DEBUG_H
--#define _VX_DEBUG_H
-+#ifndef _VSERVER_DEBUG_H
-+#define _VSERVER_DEBUG_H
-
-
- #define VXD_CBIT(n, m) (vs_debug_ ## n & (1 << (m)))
-@@ -142,4 +142,4 @@ void dump_vx_info_inactive(int);
- #endif
-
-
--#endif /* _VX_DEBUG_H */
-+#endif /* _VSERVER_DEBUG_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/debug_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/debug_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/debug_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/debug_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,28 +1,8 @@
--#ifndef _VX_DEBUG_CMD_H
--#define _VX_DEBUG_CMD_H
--
--
--/* debug commands */
--
--#define VCMD_dump_history VC_CMD(DEBUG, 1, 0)
--
--#define VCMD_read_history VC_CMD(DEBUG, 5, 0)
--#define VCMD_read_monitor VC_CMD(DEBUG, 6, 0)
--
--struct vcmd_read_history_v0 {
-- uint32_t index;
-- uint32_t count;
-- char __user *data;
--};
--
--struct vcmd_read_monitor_v0 {
-- uint32_t index;
-- uint32_t count;
-- char __user *data;
--};
-+#ifndef _VSERVER_DEBUG_CMD_H
-+#define _VSERVER_DEBUG_CMD_H
-
-+#include <uapi/vserver/debug_cmd.h>
-
--#ifdef __KERNEL__
-
- #ifdef CONFIG_COMPAT
-
-@@ -54,5 +34,4 @@ extern int vc_read_monitor_x32(uint32_t,
-
- #endif /* CONFIG_COMPAT */
-
--#endif /* __KERNEL__ */
--#endif /* _VX_DEBUG_CMD_H */
-+#endif /* _VSERVER_DEBUG_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/device.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/device.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/device.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/device.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,15 +1,9 @@
--#ifndef _VX_DEVICE_H
--#define _VX_DEVICE_H
--
--
--#define DATTR_CREATE 0x00000001
--#define DATTR_OPEN 0x00000002
--
--#define DATTR_REMAP 0x00000010
-+#ifndef _VSERVER_DEVICE_H
-+#define _VSERVER_DEVICE_H
-
--#define DATTR_MASK 0x00000013
-
-+#include <uapi/vserver/device.h>
-
--#else /* _VX_DEVICE_H */
-+#else /* _VSERVER_DEVICE_H */
- #warning duplicate inclusion
--#endif /* _VX_DEVICE_H */
-+#endif /* _VSERVER_DEVICE_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/device_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/device_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/device_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/device_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,20 +1,8 @@
--#ifndef _VX_DEVICE_CMD_H
--#define _VX_DEVICE_CMD_H
--
--
--/* device vserver commands */
--
--#define VCMD_set_mapping VC_CMD(DEVICE, 1, 0)
--#define VCMD_unset_mapping VC_CMD(DEVICE, 2, 0)
--
--struct vcmd_set_mapping_v0 {
-- const char __user *device;
-- const char __user *target;
-- uint32_t flags;
--};
-+#ifndef _VSERVER_DEVICE_CMD_H
-+#define _VSERVER_DEVICE_CMD_H
-
-+#include <uapi/vserver/device_cmd.h>
-
--#ifdef __KERNEL__
-
- #ifdef CONFIG_COMPAT
-
-@@ -40,5 +28,4 @@ extern int vc_unset_mapping_x32(struct v
-
- #endif /* CONFIG_COMPAT */
-
--#endif /* __KERNEL__ */
--#endif /* _VX_DEVICE_CMD_H */
-+#endif /* _VSERVER_DEVICE_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/device_def.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/device_def.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/device_def.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/device_def.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_DEVICE_DEF_H
--#define _VX_DEVICE_DEF_H
-+#ifndef _VSERVER_DEVICE_DEF_H
-+#define _VSERVER_DEVICE_DEF_H
-
- #include <linux/types.h>
-
-@@ -14,4 +14,4 @@ struct _vx_device {
- #endif
- };
-
--#endif /* _VX_DEVICE_DEF_H */
-+#endif /* _VSERVER_DEVICE_DEF_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/dlimit.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/dlimit.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/dlimit.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/dlimit.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_DLIMIT_H
--#define _VX_DLIMIT_H
-+#ifndef _VSERVER_DLIMIT_H
-+#define _VSERVER_DLIMIT_H
-
- #include "switch.h"
-
-@@ -49,6 +49,6 @@ extern void vx_vsi_statfs(struct super_b
- typedef uint64_t dlsize_t;
-
- #endif /* __KERNEL__ */
--#else /* _VX_DLIMIT_H */
-+#else /* _VSERVER_DLIMIT_H */
- #warning duplicate inclusion
--#endif /* _VX_DLIMIT_H */
-+#endif /* _VSERVER_DLIMIT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/dlimit_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/dlimit_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/dlimit_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/dlimit_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,70 +1,8 @@
--#ifndef _VX_DLIMIT_CMD_H
--#define _VX_DLIMIT_CMD_H
--
--
--/* dlimit vserver commands */
--
--#define VCMD_add_dlimit VC_CMD(DLIMIT, 1, 0)
--#define VCMD_rem_dlimit VC_CMD(DLIMIT, 2, 0)
--
--#define VCMD_set_dlimit VC_CMD(DLIMIT, 5, 0)
--#define VCMD_get_dlimit VC_CMD(DLIMIT, 6, 0)
--
--struct vcmd_ctx_dlimit_base_v0 {
-- const char __user *name;
-- uint32_t flags;
--};
--
--struct vcmd_ctx_dlimit_v0 {
-- const char __user *name;
-- uint32_t space_used; /* used space in kbytes */
-- uint32_t space_total; /* maximum space in kbytes */
-- uint32_t inodes_used; /* used inodes */
-- uint32_t inodes_total; /* maximum inodes */
-- uint32_t reserved; /* reserved for root in % */
-- uint32_t flags;
--};
--
--#define CDLIM_UNSET ((uint32_t)0UL)
--#define CDLIM_INFINITY ((uint32_t)~0UL)
--#define CDLIM_KEEP ((uint32_t)~1UL)
--
--#define DLIME_UNIT 0
--#define DLIME_KILO 1
--#define DLIME_MEGA 2
--#define DLIME_GIGA 3
--
--#define DLIMF_SHIFT 0x10
--
--#define DLIMS_USED 0
--#define DLIMS_TOTAL 2
--
--static inline
--uint64_t dlimit_space_32to64(uint32_t val, uint32_t flags, int shift)
--{
-- int exp = (flags & DLIMF_SHIFT) ?
-- (flags >> shift) & DLIME_GIGA : DLIME_KILO;
-- return ((uint64_t)val) << (10 * exp);
--}
--
--static inline
--uint32_t dlimit_space_64to32(uint64_t val, uint32_t *flags, int shift)
--{
-- int exp = 0;
-+#ifndef _VSERVER_DLIMIT_CMD_H
-+#define _VSERVER_DLIMIT_CMD_H
-
-- if (*flags & DLIMF_SHIFT) {
-- while (val > (1LL << 32) && (exp < 3)) {
-- val >>= 10;
-- exp++;
-- }
-- *flags &= ~(DLIME_GIGA << shift);
-- *flags |= exp << shift;
-- } else
-- val >>= 10;
-- return val;
--}
-+#include <uapi/vserver/dlimit_cmd.h>
-
--#ifdef __KERNEL__
-
- #ifdef CONFIG_COMPAT
-
-@@ -105,5 +43,4 @@ extern int vc_get_dlimit_x32(uint32_t, v
-
- #endif /* CONFIG_COMPAT */
-
--#endif /* __KERNEL__ */
--#endif /* _VX_DLIMIT_CMD_H */
-+#endif /* _VSERVER_DLIMIT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/global.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/global.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/global.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/global.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_GLOBAL_H
--#define _VX_GLOBAL_H
-+#ifndef _VSERVER_GLOBAL_H
-+#define _VSERVER_GLOBAL_H
-
-
- extern atomic_t vx_global_ctotal;
-@@ -16,4 +16,4 @@ extern atomic_t vs_global_user_ns;
- extern atomic_t vs_global_pid_ns;
-
-
--#endif /* _VX_GLOBAL_H */
-+#endif /* _VSERVER_GLOBAL_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/history.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/history.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/history.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/history.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_HISTORY_H
--#define _VX_HISTORY_H
-+#ifndef _VSERVER_HISTORY_H
-+#define _VSERVER_HISTORY_H
-
-
- enum {
-@@ -194,4 +194,4 @@ extern void vxh_dump_history(void);
-
- #endif /* CONFIG_VSERVER_HISTORY */
-
--#endif /* _VX_HISTORY_H */
-+#endif /* _VSERVER_HISTORY_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/inode.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/inode.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/inode.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/inode.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,20 +1,7 @@
--#ifndef _VX_INODE_H
--#define _VX_INODE_H
--
--
--#define IATTR_TAG 0x01000000
--
--#define IATTR_ADMIN 0x00000001
--#define IATTR_WATCH 0x00000002
--#define IATTR_HIDE 0x00000004
--#define IATTR_FLAGS 0x00000007
--
--#define IATTR_BARRIER 0x00010000
--#define IATTR_IXUNLINK 0x00020000
--#define IATTR_IMMUTABLE 0x00040000
--#define IATTR_COW 0x00080000
-+#ifndef _VSERVER_INODE_H
-+#define _VSERVER_INODE_H
-
--#ifdef __KERNEL__
-+#include <uapi/vserver/inode.h>
-
-
- #ifdef CONFIG_VSERVER_PROC_SECURE
-@@ -27,13 +14,6 @@
-
- #define vx_hide_check(c, m) (((m) & IATTR_HIDE) ? vx_check(c, m) : 1)
-
--#endif /* __KERNEL__ */
--
--/* inode ioctls */
--
--#define FIOC_GETXFLG _IOR('x', 5, long)
--#define FIOC_SETXFLG _IOW('x', 6, long)
--
--#else /* _VX_INODE_H */
-+#else /* _VSERVER_INODE_H */
- #warning duplicate inclusion
--#endif /* _VX_INODE_H */
-+#endif /* _VSERVER_INODE_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/inode_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/inode_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/inode_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/inode_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,30 +1,8 @@
--#ifndef _VX_INODE_CMD_H
--#define _VX_INODE_CMD_H
--
--
--/* inode vserver commands */
--
--#define VCMD_get_iattr VC_CMD(INODE, 1, 1)
--#define VCMD_set_iattr VC_CMD(INODE, 2, 1)
--
--#define VCMD_fget_iattr VC_CMD(INODE, 3, 0)
--#define VCMD_fset_iattr VC_CMD(INODE, 4, 0)
--
--struct vcmd_ctx_iattr_v1 {
-- const char __user *name;
-- uint32_t tag;
-- uint32_t flags;
-- uint32_t mask;
--};
--
--struct vcmd_ctx_fiattr_v0 {
-- uint32_t tag;
-- uint32_t flags;
-- uint32_t mask;
--};
-+#ifndef _VSERVER_INODE_CMD_H
-+#define _VSERVER_INODE_CMD_H
-
-+#include <uapi/vserver/inode_cmd.h>
-
--#ifdef __KERNEL__
-
-
- #ifdef CONFIG_COMPAT
-@@ -55,5 +33,4 @@ extern int vc_set_iattr_x32(void __user
-
- #endif /* CONFIG_COMPAT */
-
--#endif /* __KERNEL__ */
--#endif /* _VX_INODE_CMD_H */
-+#endif /* _VSERVER_INODE_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,17 +1,8 @@
--#ifndef _VX_LIMIT_H
--#define _VX_LIMIT_H
--
--#define VLIMIT_NSOCK 16
--#define VLIMIT_OPENFD 17
--#define VLIMIT_ANON 18
--#define VLIMIT_SHMEM 19
--#define VLIMIT_SEMARY 20
--#define VLIMIT_NSEMS 21
--#define VLIMIT_DENTRY 22
--#define VLIMIT_MAPPED 23
-+#ifndef _VSERVER_LIMIT_H
-+#define _VSERVER_LIMIT_H
-
-+#include <uapi/vserver/limit.h>
-
--#ifdef __KERNEL__
-
- #define VLIM_NOCHECK ((1L << VLIMIT_DENTRY) | (1L << RLIMIT_RSS))
-
-@@ -67,5 +58,4 @@ long vx_vsi_cached(struct sysinfo *);
-
- #define NUM_LIMITS 24
-
--#endif /* __KERNEL__ */
--#endif /* _VX_LIMIT_H */
-+#endif /* _VSERVER_LIMIT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,43 +1,8 @@
--#ifndef _VX_LIMIT_CMD_H
--#define _VX_LIMIT_CMD_H
--
--
--/* rlimit vserver commands */
--
--#define VCMD_get_rlimit VC_CMD(RLIMIT, 1, 0)
--#define VCMD_set_rlimit VC_CMD(RLIMIT, 2, 0)
--#define VCMD_get_rlimit_mask VC_CMD(RLIMIT, 3, 0)
--#define VCMD_reset_hits VC_CMD(RLIMIT, 7, 0)
--#define VCMD_reset_minmax VC_CMD(RLIMIT, 9, 0)
--
--struct vcmd_ctx_rlimit_v0 {
-- uint32_t id;
-- uint64_t minimum;
-- uint64_t softlimit;
-- uint64_t maximum;
--};
--
--struct vcmd_ctx_rlimit_mask_v0 {
-- uint32_t minimum;
-- uint32_t softlimit;
-- 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;
--};
-+#ifndef _VSERVER_LIMIT_CMD_H
-+#define _VSERVER_LIMIT_CMD_H
-
--#define CRLIM_UNSET (0ULL)
--#define CRLIM_INFINITY (~0ULL)
--#define CRLIM_KEEP (~1ULL)
-+#include <uapi/vserver/limit_cmd.h>
-
--#ifdef __KERNEL__
-
- #ifdef CONFIG_IA32_EMULATION
-
-@@ -67,5 +32,4 @@ extern int vc_set_rlimit_x32(struct vx_i
-
- #endif /* CONFIG_IA32_EMULATION */
-
--#endif /* __KERNEL__ */
--#endif /* _VX_LIMIT_CMD_H */
-+#endif /* _VSERVER_LIMIT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit_def.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit_def.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit_def.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit_def.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_LIMIT_DEF_H
--#define _VX_LIMIT_DEF_H
-+#ifndef _VSERVER_LIMIT_DEF_H
-+#define _VSERVER_LIMIT_DEF_H
-
- #include <asm/atomic.h>
- #include <asm/resource.h>
-@@ -44,4 +44,4 @@ static inline void __dump_vx_limit(struc
-
- #endif
-
--#endif /* _VX_LIMIT_DEF_H */
-+#endif /* _VSERVER_LIMIT_DEF_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit_int.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit_int.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/limit_int.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/limit_int.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,9 +1,5 @@
--#ifndef _VX_LIMIT_INT_H
--#define _VX_LIMIT_INT_H
--
--#include "context.h"
--
--#ifdef __KERNEL__
-+#ifndef _VSERVER_LIMIT_INT_H
-+#define _VSERVER_LIMIT_INT_H
-
- #define VXD_RCRES_COND(r) VXD_CBIT(cres, r)
- #define VXD_RLIMIT_COND(r) VXD_CBIT(limit, r)
-@@ -194,5 +190,4 @@ static inline void vx_limit_fixup(struct
- }
-
-
--#endif /* __KERNEL__ */
--#endif /* _VX_LIMIT_INT_H */
-+#endif /* _VSERVER_LIMIT_INT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/monitor.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/monitor.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/monitor.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/monitor.h 2012-12-13 22:45:02.000000000 +0000
-@@ -1,96 +1,6 @@
--#ifndef _VX_MONITOR_H
--#define _VX_MONITOR_H
--
--#include <linux/types.h>
--
--enum {
-- VXM_UNUSED = 0,
--
-- VXM_SYNC = 0x10,
--
-- VXM_UPDATE = 0x20,
-- VXM_UPDATE_1,
-- VXM_UPDATE_2,
--
-- VXM_RQINFO_1 = 0x24,
-- VXM_RQINFO_2,
--
-- VXM_ACTIVATE = 0x40,
-- VXM_DEACTIVATE,
-- VXM_IDLE,
--
-- VXM_HOLD = 0x44,
-- VXM_UNHOLD,
--
-- VXM_MIGRATE = 0x48,
-- VXM_RESCHED,
--
-- /* all other bits are flags */
-- VXM_SCHED = 0x80,
--};
--
--struct _vxm_update_1 {
-- uint32_t tokens_max;
-- uint32_t fill_rate;
-- uint32_t interval;
--};
--
--struct _vxm_update_2 {
-- uint32_t tokens_min;
-- uint32_t fill_rate;
-- uint32_t interval;
--};
--
--struct _vxm_rqinfo_1 {
-- uint16_t running;
-- uint16_t onhold;
-- uint16_t iowait;
-- uint16_t uintr;
-- uint32_t idle_tokens;
--};
--
--struct _vxm_rqinfo_2 {
-- uint32_t norm_time;
-- uint32_t idle_time;
-- uint32_t idle_skip;
--};
--
--struct _vxm_sched {
-- uint32_t tokens;
-- uint32_t norm_time;
-- uint32_t idle_time;
--};
--
--struct _vxm_task {
-- uint16_t pid;
-- uint16_t state;
--};
--
--struct _vxm_event {
-- uint32_t jif;
-- union {
-- uint32_t seq;
-- uint32_t sec;
-- };
-- union {
-- uint32_t tokens;
-- uint32_t nsec;
-- struct _vxm_task tsk;
-- };
--};
--
--struct _vx_mon_entry {
-- uint16_t type;
-- uint16_t xid;
-- union {
-- struct _vxm_event ev;
-- struct _vxm_sched sd;
-- struct _vxm_update_1 u1;
-- struct _vxm_update_2 u2;
-- struct _vxm_rqinfo_1 q1;
-- struct _vxm_rqinfo_2 q2;
-- };
--};
-+#ifndef _VSERVER_MONITOR_H
-+#define _VSERVER_MONITOR_H
-
-+#include <uapi/vserver/monitor.h>
-
--#endif /* _VX_MONITOR_H */
-+#endif /* _VSERVER_MONITOR_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/network.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/network.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/network.h 2012-12-13 13:40:52.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/network.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,79 +1,6 @@
--#ifndef _VX_NETWORK_H
--#define _VX_NETWORK_H
--
--#include <linux/types.h>
--
--
--#define MAX_N_CONTEXT 65535 /* Arbitrary limit */
--
--
--/* network flags */
--
--#define NXF_INFO_PRIVATE 0x00000008
--
--#define NXF_SINGLE_IP 0x00000100
--#define NXF_LBACK_REMAP 0x00000200
--#define NXF_LBACK_ALLOW 0x00000400
--
--#define NXF_HIDE_NETIF 0x02000000
--#define NXF_HIDE_LBACK 0x04000000
--
--#define NXF_STATE_SETUP (1ULL << 32)
--#define NXF_STATE_ADMIN (1ULL << 34)
--
--#define NXF_SC_HELPER (1ULL << 36)
--#define NXF_PERSISTENT (1ULL << 38)
--
--#define NXF_ONE_TIME (0x0005ULL << 32)
--
--
--#define NXF_INIT_SET (__nxf_init_set())
--
--static inline uint64_t __nxf_init_set(void) {
-- return NXF_STATE_ADMIN
--#ifdef CONFIG_VSERVER_AUTO_LBACK
-- | NXF_LBACK_REMAP
-- | NXF_HIDE_LBACK
--#endif
--#ifdef CONFIG_VSERVER_AUTO_SINGLE
-- | NXF_SINGLE_IP
--#endif
-- | NXF_HIDE_NETIF;
--}
--
--
--/* network caps */
--
--#define NXC_TUN_CREATE 0x00000001
--
--#define NXC_RAW_ICMP 0x00000100
--
--#define NXC_MULTICAST 0x00001000
--
--
--/* address types */
--
--#define NXA_TYPE_IPV4 0x0001
--#define NXA_TYPE_IPV6 0x0002
--
--#define NXA_TYPE_NONE 0x0000
--#define NXA_TYPE_ANY 0x00FF
--
--#define NXA_TYPE_ADDR 0x0010
--#define NXA_TYPE_MASK 0x0020
--#define NXA_TYPE_RANGE 0x0040
--
--#define NXA_MASK_ALL (NXA_TYPE_ADDR | NXA_TYPE_MASK | NXA_TYPE_RANGE)
--
--#define NXA_MOD_BCAST 0x0100
--#define NXA_MOD_LBACK 0x0200
--
--#define NXA_LOOPBACK 0x1000
--
--#define NXA_MASK_BIND (NXA_MASK_ALL | NXA_MOD_BCAST | NXA_MOD_LBACK)
--#define NXA_MASK_SHOW (NXA_MASK_ALL | NXA_LOOPBACK)
-+#ifndef _VSERVER_NETWORK_H
-+#define _VSERVER_NETWORK_H
-
--#ifdef __KERNEL__
-
- #include <linux/list.h>
- #include <linux/spinlock.h>
-@@ -81,6 +8,7 @@ static inline uint64_t __nxf_init_set(vo
- #include <linux/in.h>
- #include <linux/in6.h>
- #include <asm/atomic.h>
-+#include <uapi/vserver/network.h>
-
- struct nx_addr_v4 {
- struct nx_addr_v4 *next;
-@@ -145,5 +73,4 @@ struct sock;
- #define NX_IPV6(n) (0)
- #endif
-
--#endif /* __KERNEL__ */
--#endif /* _VX_NETWORK_H */
-+#endif /* _VSERVER_NETWORK_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/network_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/network_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/network_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/network_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,110 +1,12 @@
--#ifndef _VX_NETWORK_CMD_H
--#define _VX_NETWORK_CMD_H
--
--
--/* vinfo commands */
-+#ifndef _VSERVER_NETWORK_CMD_H
-+#define _VSERVER_NETWORK_CMD_H
-
--#define VCMD_task_nid VC_CMD(VINFO, 2, 0)
-+#include <uapi/vserver/network_cmd.h>
-
--#ifdef __KERNEL__
- extern int vc_task_nid(uint32_t);
-
--#endif /* __KERNEL__ */
--
--#define VCMD_nx_info VC_CMD(VINFO, 6, 0)
--
--struct vcmd_nx_info_v0 {
-- uint32_t nid;
-- /* more to come */
--};
--
--#ifdef __KERNEL__
- extern int vc_nx_info(struct nx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--#include <linux/in.h>
--#include <linux/in6.h>
--
--#define VCMD_net_create_v0 VC_CMD(VNET, 1, 0)
--#define VCMD_net_create VC_CMD(VNET, 1, 1)
--
--struct vcmd_net_create {
-- uint64_t flagword;
--};
--
--#define VCMD_net_migrate VC_CMD(NETMIG, 1, 0)
--
--#define VCMD_net_add VC_CMD(NETALT, 1, 0)
--#define VCMD_net_remove VC_CMD(NETALT, 2, 0)
--
--struct vcmd_net_addr_v0 {
-- uint16_t type;
-- uint16_t count;
-- struct in_addr ip[4];
-- struct in_addr mask[4];
--};
--
--#define VCMD_net_add_ipv4_v1 VC_CMD(NETALT, 1, 1)
--#define VCMD_net_rem_ipv4_v1 VC_CMD(NETALT, 2, 1)
--
--struct vcmd_net_addr_ipv4_v1 {
-- uint16_t type;
-- uint16_t flags;
-- struct in_addr ip;
-- struct in_addr mask;
--};
--
--#define VCMD_net_add_ipv4 VC_CMD(NETALT, 1, 2)
--#define VCMD_net_rem_ipv4 VC_CMD(NETALT, 2, 2)
--
--struct vcmd_net_addr_ipv4_v2 {
-- uint16_t type;
-- uint16_t flags;
-- struct in_addr ip;
-- struct in_addr ip2;
-- struct in_addr mask;
--};
--
--#define VCMD_net_add_ipv6 VC_CMD(NETALT, 3, 1)
--#define VCMD_net_remove_ipv6 VC_CMD(NETALT, 4, 1)
--
--struct vcmd_net_addr_ipv6_v1 {
-- uint16_t type;
-- uint16_t flags;
-- uint32_t prefix;
-- struct in6_addr ip;
-- struct in6_addr mask;
--};
--
--#define VCMD_add_match_ipv4 VC_CMD(NETALT, 5, 0)
--#define VCMD_get_match_ipv4 VC_CMD(NETALT, 6, 0)
--
--struct vcmd_match_ipv4_v0 {
-- uint16_t type;
-- uint16_t flags;
-- uint16_t parent;
-- uint16_t prefix;
-- struct in_addr ip;
-- struct in_addr ip2;
-- struct in_addr mask;
--};
--
--#define VCMD_add_match_ipv6 VC_CMD(NETALT, 7, 0)
--#define VCMD_get_match_ipv6 VC_CMD(NETALT, 8, 0)
--
--struct vcmd_match_ipv6_v0 {
-- uint16_t type;
-- uint16_t flags;
-- uint16_t parent;
-- uint16_t prefix;
-- struct in6_addr ip;
-- struct in6_addr ip2;
-- struct in6_addr mask;
--};
--
--
--#ifdef __KERNEL__
- extern int vc_net_create(uint32_t, void __user *);
- extern int vc_net_migrate(struct nx_info *, void __user *);
-
-@@ -126,39 +28,10 @@ extern int vc_get_match_ipv4(struct nx_i
- extern int vc_add_match_ipv6(struct nx_info *, void __user *);
- extern int vc_get_match_ipv6(struct nx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* flag commands */
--
--#define VCMD_get_nflags VC_CMD(FLAGS, 5, 0)
--#define VCMD_set_nflags VC_CMD(FLAGS, 6, 0)
--
--struct vcmd_net_flags_v0 {
-- uint64_t flagword;
-- uint64_t mask;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_nflags(struct nx_info *, void __user *);
- extern int vc_set_nflags(struct nx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--
--/* network caps commands */
--
--#define VCMD_get_ncaps VC_CMD(FLAGS, 7, 0)
--#define VCMD_set_ncaps VC_CMD(FLAGS, 8, 0)
--
--struct vcmd_net_caps_v0 {
-- uint64_t ncaps;
-- uint64_t cmask;
--};
--
--#ifdef __KERNEL__
- extern int vc_get_ncaps(struct nx_info *, void __user *);
- extern int vc_set_ncaps(struct nx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_CONTEXT_CMD_H */
-+#endif /* _VSERVER_CONTEXT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/percpu.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/percpu.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/percpu.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/percpu.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_PERCPU_H
--#define _VX_PERCPU_H
-+#ifndef _VSERVER_PERCPU_H
-+#define _VSERVER_PERCPU_H
-
- #include "cvirt_def.h"
- #include "sched_def.h"
-@@ -11,4 +11,4 @@ struct _vx_percpu {
-
- #define PERCPU_PERCTX (sizeof(struct _vx_percpu))
-
--#endif /* _VX_PERCPU_H */
-+#endif /* _VSERVER_PERCPU_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/sched.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/sched.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/sched.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/sched.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_SCHED_H
--#define _VX_SCHED_H
-+#ifndef _VSERVER_SCHED_H
-+#define _VSERVER_SCHED_H
-
-
- #ifdef __KERNEL__
-@@ -18,6 +18,6 @@ void vx_update_sched_param(struct _vx_sc
- struct _vx_sched_pc *sched_pc);
-
- #endif /* __KERNEL__ */
--#else /* _VX_SCHED_H */
-+#else /* _VSERVER_SCHED_H */
- #warning duplicate inclusion
--#endif /* _VX_SCHED_H */
-+#endif /* _VSERVER_SCHED_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/sched_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/sched_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/sched_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/sched_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,21 +1,11 @@
--#ifndef _VX_SCHED_CMD_H
--#define _VX_SCHED_CMD_H
--
--
--struct vcmd_prio_bias {
-- int32_t cpu_id;
-- int32_t prio_bias;
--};
--
--#define VCMD_set_prio_bias VC_CMD(SCHED, 4, 0)
--#define VCMD_get_prio_bias VC_CMD(SCHED, 5, 0)
-+#ifndef _VSERVER_SCHED_CMD_H
-+#define _VSERVER_SCHED_CMD_H
-
--#ifdef __KERNEL__
-
- #include <linux/compiler.h>
-+#include <uapi/vserver/sched_cmd.h>
-
- extern int vc_set_prio_bias(struct vx_info *, void __user *);
- extern int vc_get_prio_bias(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_SCHED_CMD_H */
-+#endif /* _VSERVER_SCHED_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/sched_def.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/sched_def.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/sched_def.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/sched_def.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_SCHED_DEF_H
--#define _VX_SCHED_DEF_H
-+#ifndef _VSERVER_SCHED_DEF_H
-+#define _VSERVER_SCHED_DEF_H
-
- #include <linux/spinlock.h>
- #include <linux/jiffies.h>
-@@ -35,4 +35,4 @@ static inline void __dump_vx_sched(struc
-
- #endif
-
--#endif /* _VX_SCHED_DEF_H */
-+#endif /* _VSERVER_SCHED_DEF_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/signal.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/signal.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/signal.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/signal.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_SIGNAL_H
--#define _VX_SIGNAL_H
-+#ifndef _VSERVER_SIGNAL_H
-+#define _VSERVER_SIGNAL_H
-
-
- #ifdef __KERNEL__
-@@ -9,6 +9,6 @@ struct vx_info;
- int vx_info_kill(struct vx_info *, int, int);
-
- #endif /* __KERNEL__ */
--#else /* _VX_SIGNAL_H */
-+#else /* _VSERVER_SIGNAL_H */
- #warning duplicate inclusion
--#endif /* _VX_SIGNAL_H */
-+#endif /* _VSERVER_SIGNAL_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/signal_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/signal_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/signal_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/signal_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,43 +1,14 @@
--#ifndef _VX_SIGNAL_CMD_H
--#define _VX_SIGNAL_CMD_H
--
--
--/* signalling vserver commands */
--
--#define VCMD_ctx_kill VC_CMD(PROCTRL, 1, 0)
--#define VCMD_wait_exit VC_CMD(EVENT, 99, 0)
--
--struct vcmd_ctx_kill_v0 {
-- int32_t pid;
-- int32_t sig;
--};
-+#ifndef _VSERVER_SIGNAL_CMD_H
-+#define _VSERVER_SIGNAL_CMD_H
-
--struct vcmd_wait_exit_v0 {
-- int32_t reboot_cmd;
-- int32_t exit_code;
--};
-+#include <uapi/vserver/signal_cmd.h>
-
--#ifdef __KERNEL__
-
- extern int vc_ctx_kill(struct vx_info *, void __user *);
- extern int vc_wait_exit(struct vx_info *, void __user *);
-
--#endif /* __KERNEL__ */
--
--/* process alteration commands */
--
--#define VCMD_get_pflags VC_CMD(PROCALT, 5, 0)
--#define VCMD_set_pflags VC_CMD(PROCALT, 6, 0)
--
--struct vcmd_pflags_v0 {
-- uint32_t flagword;
-- uint32_t mask;
--};
--
--#ifdef __KERNEL__
-
- extern int vc_get_pflags(uint32_t pid, void __user *);
- extern int vc_set_pflags(uint32_t pid, void __user *);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_SIGNAL_CMD_H */
-+#endif /* _VSERVER_SIGNAL_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/space.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/space.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/space.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/space.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,5 +1,5 @@
--#ifndef _VX_SPACE_H
--#define _VX_SPACE_H
-+#ifndef _VSERVER_SPACE_H
-+#define _VSERVER_SPACE_H
-
- #include <linux/types.h>
-
-@@ -7,6 +7,6 @@ struct vx_info;
-
- int vx_set_space(struct vx_info *vxi, unsigned long mask, unsigned index);
-
--#else /* _VX_SPACE_H */
-+#else /* _VSERVER_SPACE_H */
- #warning duplicate inclusion
--#endif /* _VX_SPACE_H */
-+#endif /* _VSERVER_SPACE_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/space_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/space_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/space_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/space_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,32 +1,8 @@
--#ifndef _VX_SPACE_CMD_H
--#define _VX_SPACE_CMD_H
--
--
--#define VCMD_enter_space_v0 VC_CMD(PROCALT, 1, 0)
--#define VCMD_enter_space_v1 VC_CMD(PROCALT, 1, 1)
--#define VCMD_enter_space VC_CMD(PROCALT, 1, 2)
--
--#define VCMD_set_space_v0 VC_CMD(PROCALT, 3, 0)
--#define VCMD_set_space_v1 VC_CMD(PROCALT, 3, 1)
--#define VCMD_set_space VC_CMD(PROCALT, 3, 2)
--
--#define VCMD_get_space_mask_v0 VC_CMD(PROCALT, 4, 0)
--
--#define VCMD_get_space_mask VC_CMD(VSPACE, 0, 1)
--#define VCMD_get_space_default VC_CMD(VSPACE, 1, 0)
--
--
--struct vcmd_space_mask_v1 {
-- uint64_t mask;
--};
--
--struct vcmd_space_mask_v2 {
-- uint64_t mask;
-- uint32_t index;
--};
-+#ifndef _VSERVER_SPACE_CMD_H
-+#define _VSERVER_SPACE_CMD_H
-
-+#include <uapi/vserver/space_cmd.h>
-
--#ifdef __KERNEL__
-
- extern int vc_enter_space_v1(struct vx_info *, void __user *);
- extern int vc_set_space_v1(struct vx_info *, void __user *);
-@@ -34,5 +10,4 @@ extern int vc_enter_space(struct vx_info
- extern int vc_set_space(struct vx_info *, void __user *);
- extern int vc_get_space_mask(void __user *, int);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_SPACE_CMD_H */
-+#endif /* _VSERVER_SPACE_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/switch.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/switch.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/switch.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/switch.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,98 +1,8 @@
--#ifndef _VX_SWITCH_H
--#define _VX_SWITCH_H
--
--#include <linux/types.h>
--
--
--#define VC_CATEGORY(c) (((c) >> 24) & 0x3F)
--#define VC_COMMAND(c) (((c) >> 16) & 0xFF)
--#define VC_VERSION(c) ((c) & 0xFFF)
--
--#define VC_CMD(c, i, v) ((((VC_CAT_ ## c) & 0x3F) << 24) \
-- | (((i) & 0xFF) << 16) | ((v) & 0xFFF))
--
--/*
--
-- Syscall Matrix V2.8
--
-- |VERSION|CREATE |MODIFY |MIGRATE|CONTROL|EXPERIM| |SPECIAL|SPECIAL|
-- |STATS |DESTROY|ALTER |CHANGE |LIMIT |TEST | | | |
-- |INFO |SETUP | |MOVE | | | | | |
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
-- SYSTEM |VERSION|VSETUP |VHOST | | | | |DEVICE | |
-- HOST | 00| 01| 02| 03| 04| 05| | 06| 07|
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
-- CPU | |VPROC |PROCALT|PROCMIG|PROCTRL| | |SCHED. | |
-- PROCESS| 08| 09| 10| 11| 12| 13| | 14| 15|
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
-- MEMORY | | | | |MEMCTRL| | |SWAP | |
-- | 16| 17| 18| 19| 20| 21| | 22| 23|
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
-- NETWORK| |VNET |NETALT |NETMIG |NETCTL | | |SERIAL | |
-- | 24| 25| 26| 27| 28| 29| | 30| 31|
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
-- DISK | | | |TAGMIG |DLIMIT | | |INODE | |
-- VFS | 32| 33| 34| 35| 36| 37| | 38| 39|
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
-- OTHER |VSTAT | | | | | | |VINFO | |
-- | 40| 41| 42| 43| 44| 45| | 46| 47|
-- =======+=======+=======+=======+=======+=======+=======+ +=======+=======+
-- SPECIAL|EVENT | | | |FLAGS | | |VSPACE | |
-- | 48| 49| 50| 51| 52| 53| | 54| 55|
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
-- SPECIAL|DEBUG | | | |RLIMIT |SYSCALL| | |COMPAT |
-- | 56| 57| 58| 59| 60|TEST 61| | 62| 63|
-- -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
--
--*/
--
--#define VC_CAT_VERSION 0
--
--#define VC_CAT_VSETUP 1
--#define VC_CAT_VHOST 2
--
--#define VC_CAT_DEVICE 6
--
--#define VC_CAT_VPROC 9
--#define VC_CAT_PROCALT 10
--#define VC_CAT_PROCMIG 11
--#define VC_CAT_PROCTRL 12
--
--#define VC_CAT_SCHED 14
--#define VC_CAT_MEMCTRL 20
--
--#define VC_CAT_VNET 25
--#define VC_CAT_NETALT 26
--#define VC_CAT_NETMIG 27
--#define VC_CAT_NETCTRL 28
--
--#define VC_CAT_TAGMIG 35
--#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
--
--#define VC_CAT_FLAGS 52
--#define VC_CAT_VSPACE 54
--#define VC_CAT_DEBUG 56
--#define VC_CAT_RLIMIT 60
--
--#define VC_CAT_SYSTEST 61
--#define VC_CAT_COMPAT 63
--
--/* query version */
--
--#define VCMD_get_version VC_CMD(VERSION, 0, 0)
--#define VCMD_get_vci VC_CMD(VERSION, 1, 0)
--
-+#ifndef _VSERVER_SWITCH_H
-+#define _VSERVER_SWITCH_H
-
--#ifdef __KERNEL__
-
- #include <linux/errno.h>
-+#include <uapi/vserver/switch.h>
-
--#endif /* __KERNEL__ */
--
--#endif /* _VX_SWITCH_H */
--
-+#endif /* _VSERVER_SWITCH_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/linux/vserver/tag_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/tag_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/linux/vserver/tag_cmd.h 2012-12-11 15:56:32.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/linux/vserver/tag_cmd.h 2012-12-13 22:29:23.000000000 +0000
-@@ -1,22 +1,10 @@
--#ifndef _VX_TAG_CMD_H
--#define _VX_TAG_CMD_H
--
--
--/* vinfo commands */
-+#ifndef _VSERVER_TAG_CMD_H
-+#define _VSERVER_TAG_CMD_H
-
--#define VCMD_task_tag VC_CMD(VINFO, 3, 0)
-+#include <uapi/vserver/tag_cmd.h>
-
--#ifdef __KERNEL__
- extern int vc_task_tag(uint32_t);
-
--#endif /* __KERNEL__ */
--
--/* context commands */
--
--#define VCMD_tag_migrate VC_CMD(TAGMIG, 1, 0)
--
--#ifdef __KERNEL__
- extern int vc_tag_migrate(uint32_t);
-
--#endif /* __KERNEL__ */
--#endif /* _VX_TAG_CMD_H */
-+#endif /* _VSERVER_TAG_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/uapi/Kbuild linux-3.7-vs2.3.5.1.3-uapi/include/uapi/Kbuild
---- linux-3.7-vs2.3.5.1.3/include/uapi/Kbuild 2012-12-11 15:47:47.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/uapi/Kbuild 2012-12-13 21:33:11.000000000 +0000
-@@ -12,3 +12,4 @@ header-y += video/
- header-y += drm/
- header-y += xen/
- header-y += scsi/
-+header-y += vserver/
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/uapi/vserver/Kbuild linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/Kbuild
---- linux-3.7-vs2.3.5.1.3/include/uapi/vserver/Kbuild 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/Kbuild 2012-12-13 21:48:50.000000000 +0000
-@@ -0,0 +1,9 @@
-+
-+header-y += context_cmd.h network_cmd.h space_cmd.h \
-+ cacct_cmd.h cvirt_cmd.h limit_cmd.h dlimit_cmd.h \
-+ inode_cmd.h tag_cmd.h sched_cmd.h signal_cmd.h \
-+ debug_cmd.h device_cmd.h
-+
-+header-y += switch.h context.h network.h monitor.h \
-+ limit.h inode.h device.h
-+
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/uapi/vserver/cacct_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/cacct_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/uapi/vserver/cacct_cmd.h 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/cacct_cmd.h 2012-12-13 22:22:21.000000000 +0000
-@@ -0,0 +1,15 @@
-+#ifndef _UAPI_VS_CACCT_CMD_H
-+#define _UAPI_VS_CACCT_CMD_H
-+
-+
-+/* virtual host info name commands */
-+
-+#define VCMD_sock_stat VC_CMD(VSTAT, 5, 0)
-+
-+struct vcmd_sock_stat_v0 {
-+ uint32_t field;
-+ uint32_t count[3];
-+ uint64_t total[3];
-+};
-+
-+#endif /* _UAPI_VS_CACCT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/uapi/vserver/context.h linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/context.h
---- linux-3.7-vs2.3.5.1.3/include/uapi/vserver/context.h 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/context.h 2012-12-13 22:22:21.000000000 +0000
-@@ -0,0 +1,80 @@
-+#ifndef _UAPI_VS_CONTEXT_H
-+#define _UAPI_VS_CONTEXT_H
-+
-+#include <linux/types.h>
-+#include <linux/capability.h>
-+
-+
-+/* context flags */
-+
-+#define VXF_INFO_SCHED 0x00000002
-+#define VXF_INFO_NPROC 0x00000004
-+#define VXF_INFO_PRIVATE 0x00000008
-+
-+#define VXF_INFO_INIT 0x00000010
-+#define VXF_INFO_HIDE 0x00000020
-+#define VXF_INFO_ULIMIT 0x00000040
-+#define VXF_INFO_NSPACE 0x00000080
-+
-+#define VXF_SCHED_HARD 0x00000100
-+#define VXF_SCHED_PRIO 0x00000200
-+#define VXF_SCHED_PAUSE 0x00000400
-+
-+#define VXF_VIRT_MEM 0x00010000
-+#define VXF_VIRT_UPTIME 0x00020000
-+#define VXF_VIRT_CPU 0x00040000
-+#define VXF_VIRT_LOAD 0x00080000
-+#define VXF_VIRT_TIME 0x00100000
-+
-+#define VXF_HIDE_MOUNT 0x01000000
-+/* was VXF_HIDE_NETIF 0x02000000 */
-+#define VXF_HIDE_VINFO 0x04000000
-+
-+#define VXF_STATE_SETUP (1ULL << 32)
-+#define VXF_STATE_INIT (1ULL << 33)
-+#define VXF_STATE_ADMIN (1ULL << 34)
-+
-+#define VXF_SC_HELPER (1ULL << 36)
-+#define VXF_REBOOT_KILL (1ULL << 37)
-+#define VXF_PERSISTENT (1ULL << 38)
-+
-+#define VXF_FORK_RSS (1ULL << 48)
-+#define VXF_PROLIFIC (1ULL << 49)
-+
-+#define VXF_IGNEG_NICE (1ULL << 52)
-+
-+#define VXF_ONE_TIME (0x0007ULL << 32)
-+
-+#define VXF_INIT_SET (VXF_STATE_SETUP | VXF_STATE_INIT | VXF_STATE_ADMIN)
-+
-+
-+/* context migration */
-+
-+#define VXM_SET_INIT 0x00000001
-+#define VXM_SET_REAPER 0x00000002
-+
-+/* context caps */
-+
-+#define VXC_SET_UTSNAME 0x00000001
-+#define VXC_SET_RLIMIT 0x00000002
-+#define VXC_FS_SECURITY 0x00000004
-+#define VXC_FS_TRUSTED 0x00000008
-+#define VXC_TIOCSTI 0x00000010
-+
-+/* was VXC_RAW_ICMP 0x00000100 */
-+#define VXC_SYSLOG 0x00001000
-+#define VXC_OOM_ADJUST 0x00002000
-+#define VXC_AUDIT_CONTROL 0x00004000
-+
-+#define VXC_SECURE_MOUNT 0x00010000
-+#define VXC_SECURE_REMOUNT 0x00020000
-+#define VXC_BINARY_MOUNT 0x00040000
-+
-+#define VXC_QUOTA_CTL 0x00100000
-+#define VXC_ADMIN_MAPPER 0x00200000
-+#define VXC_ADMIN_CLOOP 0x00400000
-+
-+#define VXC_KTHREAD 0x01000000
-+#define VXC_NAMESPACE 0x02000000
-+
-+#endif /* _UAPI_VS_CONTEXT_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/uapi/vserver/context_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/context_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/uapi/vserver/context_cmd.h 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/context_cmd.h 2012-12-13 22:22:21.000000000 +0000
-@@ -0,0 +1,115 @@
-+#ifndef _UAPI_VS_CONTEXT_CMD_H
-+#define _UAPI_VS_CONTEXT_CMD_H
-+
-+
-+/* vinfo commands */
-+
-+#define VCMD_task_xid VC_CMD(VINFO, 1, 0)
-+
-+
-+#define VCMD_vx_info VC_CMD(VINFO, 5, 0)
-+
-+struct vcmd_vx_info_v0 {
-+ uint32_t xid;
-+ uint32_t initpid;
-+ /* more to come */
-+};
-+
-+
-+#define VCMD_ctx_stat VC_CMD(VSTAT, 0, 0)
-+
-+struct vcmd_ctx_stat_v0 {
-+ uint32_t usecnt;
-+ uint32_t tasks;
-+ /* more to come */
-+};
-+
-+
-+/* context commands */
-+
-+#define VCMD_ctx_create_v0 VC_CMD(VPROC, 1, 0)
-+#define VCMD_ctx_create VC_CMD(VPROC, 1, 1)
-+
-+struct vcmd_ctx_create {
-+ uint64_t flagword;
-+};
-+
-+#define VCMD_ctx_migrate_v0 VC_CMD(PROCMIG, 1, 0)
-+#define VCMD_ctx_migrate VC_CMD(PROCMIG, 1, 1)
-+
-+struct vcmd_ctx_migrate {
-+ uint64_t flagword;
-+};
-+
-+
-+
-+/* flag commands */
-+
-+#define VCMD_get_cflags VC_CMD(FLAGS, 1, 0)
-+#define VCMD_set_cflags VC_CMD(FLAGS, 2, 0)
-+
-+struct vcmd_ctx_flags_v0 {
-+ uint64_t flagword;
-+ uint64_t mask;
-+};
-+
-+
-+
-+/* context caps commands */
-+
-+#define VCMD_get_ccaps VC_CMD(FLAGS, 3, 1)
-+#define VCMD_set_ccaps VC_CMD(FLAGS, 4, 1)
-+
-+struct vcmd_ctx_caps_v1 {
-+ uint64_t ccaps;
-+ uint64_t cmask;
-+};
-+
-+
-+
-+/* bcaps commands */
-+
-+#define VCMD_get_bcaps VC_CMD(FLAGS, 9, 0)
-+#define VCMD_set_bcaps VC_CMD(FLAGS, 10, 0)
-+
-+struct vcmd_bcaps {
-+ uint64_t bcaps;
-+ uint64_t bmask;
-+};
-+
-+
-+
-+/* umask commands */
-+
-+#define VCMD_get_umask VC_CMD(FLAGS, 13, 0)
-+#define VCMD_set_umask VC_CMD(FLAGS, 14, 0)
-+
-+struct vcmd_umask {
-+ uint64_t umask;
-+ uint64_t mask;
-+};
-+
-+
-+
-+/* wmask commands */
-+
-+#define VCMD_get_wmask VC_CMD(FLAGS, 15, 0)
-+#define VCMD_set_wmask VC_CMD(FLAGS, 16, 0)
-+
-+struct vcmd_wmask {
-+ uint64_t wmask;
-+ uint64_t mask;
-+};
-+
-+
-+
-+/* OOM badness */
-+
-+#define VCMD_get_badness VC_CMD(MEMCTRL, 5, 0)
-+#define VCMD_set_badness VC_CMD(MEMCTRL, 6, 0)
-+
-+struct vcmd_badness_v0 {
-+ int64_t bias;
-+};
-+
-+#endif /* _UAPI_VS_CONTEXT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/uapi/vserver/cvirt_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/cvirt_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/uapi/vserver/cvirt_cmd.h 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/cvirt_cmd.h 2012-12-13 22:22:21.000000000 +0000
-@@ -0,0 +1,41 @@
-+#ifndef _UAPI_VS_CVIRT_CMD_H
-+#define _UAPI_VS_CVIRT_CMD_H
-+
-+
-+/* virtual host info name commands */
-+
-+#define VCMD_set_vhi_name VC_CMD(VHOST, 1, 0)
-+#define VCMD_get_vhi_name VC_CMD(VHOST, 2, 0)
-+
-+struct vcmd_vhi_name_v0 {
-+ uint32_t field;
-+ char name[65];
-+};
-+
-+
-+enum vhi_name_field {
-+ VHIN_CONTEXT = 0,
-+ VHIN_SYSNAME,
-+ VHIN_NODENAME,
-+ VHIN_RELEASE,
-+ VHIN_VERSION,
-+ VHIN_MACHINE,
-+ VHIN_DOMAINNAME,
-+};
-+
-+
-+
-+#define VCMD_virt_stat VC_CMD(VSTAT, 3, 0)
-+
-+struct vcmd_virt_stat_v0 {
-+ uint64_t offset;
-+ uint64_t uptime;
-+ uint32_t nr_threads;
-+ uint32_t nr_running;
-+ uint32_t nr_uninterruptible;
-+ uint32_t nr_onhold;
-+ uint32_t nr_forks;
-+ uint32_t load[3];
-+};
-+
-+#endif /* _UAPI_VS_CVIRT_CMD_H */
-diff -NurpP --minimal linux-3.7-vs2.3.5.1.3/include/uapi/vserver/debug_cmd.h linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/debug_cmd.h
---- linux-3.7-vs2.3.5.1.3/include/uapi/vserver/debug_cmd.h 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.7-vs2.3.5.1.3-uapi/include/uapi/vserver/debug_cmd.h 2012-12-13 22:22:21.000000000 +0000
-@@ -0,0 +1,24 @@
-+#ifndef _UAPI_VS_DEBUG_CMD_H
-+#define _UAPI_VS_DEBUG_CMD_H
-+
-+
-+/* debug commands */
-+
-+#define VCMD_dump_history VC_CMD(DEBUG, 1, 0)
-+
-+#define VCMD_read_history VC_CMD(DEBUG, 5, 0)
-+#define VCMD_read_monitor VC_CMD(DEBUG, 6, 0)
-+
-+struct vcmd_read_history_v0 {
-+ uint32_t index;
-+ uint32_t count;
-+ char __user *data;
-+};