2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
9 * $FreeBSD: src/sys/sys/jail.h,v 1.8.2.2 2000/11/01 17:58:06 rwatson Exp $
10 * $DragonFly: src/sys/sys/jail.h,v 1.6 2005/07/20 20:31:19 dillon Exp $
26 int jail(struct jail *);
31 #include <sys/varsym.h>
34 MALLOC_DECLARE(M_PRISON);
37 #define JAIL_MAX 999999
40 * This structure describes a prison. It is pointed to by all struct
41 * proc's of the inmates. pr_ref keeps track of them and is used to
42 * delete the struture when the last inmate is dead.
46 LIST_ENTRY(prison) pr_list; /* all prisons */
47 int pr_id; /* prison id */
48 int pr_ref; /* reference count */
49 struct namecache *pr_root; /* namecache entry of root */
50 char pr_host[MAXHOSTNAMELEN]; /* host name */
51 uint32_t pr_ip; /* IP address */
52 void *pr_linux; /* Linux ABI emulation */
53 int pr_securelevel; /* jail securelevel */
54 struct varsymset pr_varsymset; /* jail varsyms */
58 * Sysctl-set variables that determine global jail policy
60 extern int jail_set_hostname_allowed;
61 extern int jail_socket_unixiproute_only;
62 extern int jail_sysvipc_allowed;
63 extern int jail_chflags_allowed;
65 void prison_hold(struct prison *);
66 void prison_free(struct prison *);
69 * Return 1 if the passed credential is in a jail, otherwise 0.
72 jailed(struct ucred *cred)
74 return(cred->cr_prison != NULL);
78 #endif /* !_SYS_JAIL_H_ */