From owner-p4-projects@FreeBSD.ORG Fri Jun 23 07:48:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4896D16A561; Fri, 23 Jun 2006 07:48:30 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2446C16A4AB for ; Fri, 23 Jun 2006 07:48:30 +0000 (UTC) (envelope-from als@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE3C543D45 for ; Fri, 23 Jun 2006 07:48:29 +0000 (GMT) (envelope-from als@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5N7mTjP070229 for ; Fri, 23 Jun 2006 07:48:29 GMT (envelope-from als@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5N7mTsU070226 for perforce@freebsd.org; Fri, 23 Jun 2006 07:48:29 GMT (envelope-from als@FreeBSD.org) Date: Fri, 23 Jun 2006 07:48:29 GMT Message-Id: <200606230748.k5N7mTsU070226@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to als@FreeBSD.org using -f From: Alex Lyashkov To: Perforce Change Reviews Cc: Subject: PERFORCE change 99855 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2006 07:48:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=99855 Change 99855 by als@als_head on 2006/06/23 07:47:41 whitespace fixes. Affected files ... .. //depot/projects/jail2/sys/sys/jail2.h#2 edit Differences ... ==== //depot/projects/jail2/sys/sys/jail2.h#2 (text+ko) ==== @@ -63,45 +63,45 @@ #define J_STATS 7 /* contexts limits */ -#define J_SETMEMLIMIT 1 +#define J_SETMEMLIMIT 1 /* int limit */ -#define J_SETPROCLIMIT 2 +#define J_SETPROCLIMIT 2 /* int limit */ -#define J_SETVROOT 4 +#define J_SETVROOT 4 /* set as vroot dev */ -#define J_SETUSEDSPACE 5 +#define J_SETUSEDSPACE 5 /* int space in k */ -#define J_SETFILELIMIT 6 +#define J_SETFILELIMIT 6 /* int limit */ -#define J_SETRSSLIMIT 7 +#define J_SETRSSLIMIT 7 /* int RSS limit */ #define J_SETTCPSOCKETSLIMIT 8 /* int TCP established sockets limit */ #define J_SETUDPSOCKETSLIMIT 9 /* int UDP established sockets limit */ -#define J_CPUHARDLIMIT 10 +#define J_CPUHARDLIMIT 10 /* int cpu time limit - max 1024 */ -#define J_CPUSOFTLIMIT 11 +#define J_CPUSOFTLIMIT 11 /* int cpu time limit - max 1024 */ -#define J_MSQLIMIT 14 +#define J_MSQLIMIT 14 /* int message query count limit */ -#define J_SEMLIMIT 15 +#define J_SEMLIMIT 15 /* int semaphore count limit */ -#define J_SHMLIMIT 16 +#define J_SHMLIMIT 16 /* int shared memory segments count limit */ /* network stuf */ -#define J_VNETDEV_CREATE 1 -#define J_VNETDEV_REMOVE 2 +#define J_VNETDEV_CREATE 1 +#define J_VNETDEV_REMOVE 2 /* only if not have task */ -#define J_ADDMASKIPV4 5 -#define J_RMIPV4 6 +#define J_ADDMASKIPV4 5 +#define J_RMIPV4 6 /* attach vnetdev to host netdev */ -#define J_VNETDEV_ATTACH 7 +#define J_VNETDEV_ATTACH 7 /* detach vnetdev from host netdev */ -#define J_VNETDEV_DETACH 8 +#define J_VNETDEV_DETACH 8 /* set vnetdev shaper speed */ #define J_VNETDEV_SET_TXSPEED 10 @@ -111,155 +111,18 @@ #define J_VNETDEV_UNSET_FLAGS 12 /* disk stuff */ -#define J_VROOT 1 +#define J_VROOT 1 /* char *path - set root dir */ -#define J_SETINODE_ID 2 +#define J_SETINODE_ID 2 /* char *path, uint32_t prison_id */ -#define J_INODEUSAGE 12 +#define J_INODEUSAGE 3 /* int inode count used in context */ -#define J_INODELIMIT 13 +#define J_INODELIMIT 4 /* int inodes count limit for context */ -#define J_SETDISKQUOTE 3 +#define J_SETDISKQUOTE 5 /* int limit */ -#define JAIL2_COMMAND(class, cmd) (((class)<<24) | (cmd)) -#define JAIL2_CLASS(fcmd) (((fcmd)>>24) & 0xFF) -#define JAIL2_CMD(fcmd) ((fcmd) & 0xFFF) - -#ifdef _KERNEL - -struct thread; -int jail2_common(struct thread *td, struct jail_2 *j); -int jail2_network(struct thread *td, struct jail_2 *j); -int jail2_resource(struct thread *td, struct jail_2 *j); - -#endif /* !_KERNEL */ -#endif /* !_SYS_JAIL2_H_ */ -#ifndef _SYS_JAIL2_H_ -#define _SYS_JAIL2_H_ - -struct jail_2 { - uint32_t version; /* vsersion always 2*/ - uint32_t ctx_id; /* prision id */ - uint32_t cmd; /* jail2 command */ - void *data; /* pointer to command data */ -}; - -struct jail2_stats_v1 { - uint32_t flags; - /* Task & CPU */ - uint32_t taskcount; - uint32_t cpulow; - uint32_t cpuhigh; - uint32_t cpuusage; - /* IPC */ - uint32_t msq_count; /* (a) total message count */ - uint32_t msq_limit; /* (a) limits message count in jail */ - uint32_t sem_count; /* (a) total semaphore count */ - uint32_t sem_limit; /* (a) limits semaphore count in jail */ - uint32_t shm_count; /* (a) total shared segments count */ - uint32_t shm_limit; /* (a) limits shared segments count in jail */ - /* disk */ - uint32_t diskblocks; - uint32_t disklimit; - uint32_t inodecount; - uint32_t inodelimit; - /* file */ - uint32_t fdcount; - uint32_t fdlimit; -}; - -#define JAIL2_STATS_VER 1 -struct jail2_stats { - uint32_t version; - uint32_t id; - struct jail2_stats_v1 v1; -}; - - -/* jail2 commands category */ -#define J_COMMON 0x1 -#define J_NETWORK 0x2 -#define J_RESOURCE 0x3 -#define J_DISK 0x4 - -/* common staff */ -/* create context */ -#define J_CREATE 1 -/* destroy context */ -#define J_DESTROY 2 -/* allow execute programs in context */ -#define J_START 3 -/* destroy all programs and disallow execute programs in context */ -#define J_STOP 4 -/* migrate process to context */ -#define J_ENTER 5 -/* set flags for context */ -#define J_SETFLAGS 6 -/* get detaled statistic about context */ -#define J_STATS 7 - -/* contexts limits */ -#define J_SETMEMLIMIT 1 -/* int limit */ -#define J_SETPROCLIMIT 2 -/* int limit */ -#define J_SETVROOT 4 -/* set as vroot dev */ -#define J_SETUSEDSPACE 5 -/* int space in k */ -#define J_SETFILELIMIT 6 -/* int limit */ -#define J_SETRSSLIMIT 7 -/* int RSS limit */ -#define J_SETTCPSOCKETSLIMIT 8 -/* int TCP established sockets limit */ -#define J_SETUDPSOCKETSLIMIT 9 -/* int UDP established sockets limit */ -#define J_CPUHARDLIMIT 10 -/* int cpu time limit - max 1024 */ -#define J_CPUSOFTLIMIT 11 -/* int cpu time limit - max 1024 */ -#define J_MSQLIMIT 14 -/* int message query count limit */ -#define J_SEMLIMIT 15 -/* int semaphore count limit */ -#define J_SHMLIMIT 16 -/* int shared memory segments count limit */ - -/* network stuf */ -#define J_VNETDEV_CREATE 1 -#define J_VNETDEV_REMOVE 2 - -/* only if not have task */ -#define J_ADDMASKIPV4 5 -#define J_RMIPV4 6 - -/* attach vnetdev to host netdev */ -#define J_VNETDEV_ATTACH 7 -/* detach vnetdev from host netdev */ -#define J_VNETDEV_DETACH 8 - -/* set vnetdev shaper speed */ -#define J_VNETDEV_SET_TXSPEED 10 -/* set specified option flags */ -#define J_VNETDEV_SET_FLAGS 11 -/* unset specified option flags */ -#define J_VNETDEV_UNSET_FLAGS 12 - -/* disk stuff */ -#define J_VROOT 1 -/* char *path - set root dir */ -#define J_SETINODE_ID 2 -/* char *path, uint32_t prison_id */ -#define J_INODEUSAGE 12 -/* int inode count used in context */ -#define J_INODELIMIT 13 -/* int inodes count limit for context */ -#define J_SETDISKQUOTE 3 -/* int limit */ - -#define JAIL2_COMMAND(class, cmd) (((class)<<24) | (cmd)) +#define JAIL2_COMMAND(class, cmd) (((class)<<24) | (cmd)) #define JAIL2_CLASS(fcmd) (((fcmd)>>24) & 0xFF) #define JAIL2_CMD(fcmd) ((fcmd) & 0xFFF)