xref: /dragonfly/sys/sys/jail.h (revision 5153f92b)
1 /*
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  * ----------------------------------------------------------------------------
8  *
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.4 2005/01/14 02:25:08 joerg Exp $
11  *
12  */
13 
14 #ifndef _SYS_JAIL_H_
15 #define _SYS_JAIL_H_
16 
17 #include <sys/varsym.h>
18 
19 struct jail {
20 	u_int32_t	version;
21 	char		*path;
22 	char		*hostname;
23 	u_int32_t	ip_number;
24 };
25 
26 #ifndef _KERNEL
27 
28 int jail (struct jail *);
29 
30 #else /* _KERNEL */
31 
32 #ifdef MALLOC_DECLARE
33 MALLOC_DECLARE(M_PRISON);
34 #endif
35 
36 /*
37  * This structure describes a prison.  It is pointed to by all struct
38  * proc's of the inmates.  pr_ref keeps track of them and is used to
39  * delete the struture when the last inmate is dead.
40  */
41 
42 struct prison {
43 	int		pr_ref;
44 	char 		pr_host[MAXHOSTNAMELEN];
45 	u_int32_t	pr_ip;
46 	void		*pr_linux;
47 	struct varsymset pr_varsymset;
48 };
49 
50 /*
51  * Sysctl-set variables that determine global jail policy
52  */
53 extern int	jail_set_hostname_allowed;
54 extern int	jail_socket_unixiproute_only;
55 extern int	jail_sysvipc_allowed;
56 
57 #endif /* !_KERNEL */
58 #endif /* !_SYS_JAIL_H_ */
59