1/*-
2 * Copyright (c) 2010 James Gritton.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 9 unchanged lines hidden (view full) ---
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: projects/jailconf/usr.sbin/jail/jailp.h 223189 2011-06-17 16:18:44Z jamie $
27 */
28
29#include <sys/param.h>
30#include <sys/types.h>
31#include <sys/jail.h>
32#include <sys/queue.h>
33#include <sys/time.h>
34
--- 19 unchanged lines hidden (view full) ---
54#define JF_START 0x0001 /* -c */
55#define JF_SET 0x0002 /* -m */
56#define JF_STOP 0x0004 /* -r */
57#define JF_DEPEND 0x0008 /* Operation required by dependency */
58#define JF_WILD 0x0010 /* Not specified on the command line */
59#define JF_FAILED 0x0020 /* Operation failed */
60#define JF_PARAMS 0x0040 /* Parameters checked and imported */
61#define JF_RDTUN 0x0080 /* Create-only parameter check has been done */
62#define JF_PERSIST 0x0100 /* Jail is temporarily persistent */
63#define JF_TIMEOUT 0x0200 /* A command (or process kill) timed out */
64#define JF_SLEEPQ 0x0400 /* Waiting on a command and/or timeout */
65
66#define JF_OP_MASK (JF_START | JF_SET | JF_STOP)
67#define JF_RESTART (JF_START | JF_STOP)
68#define JF_START_SET (JF_START | JF_SET)
69#define JF_SET_RESTART (JF_SET | JF_STOP)
70#define JF_START_SET_RESTART (JF_START | JF_SET | JF_STOP)
71#define JF_DO_STOP(js) (((js) & (JF_SET | JF_STOP)) == JF_STOP)
72
--- 22 unchanged lines hidden (view full) ---
95 IP_MOUNT_FSTAB, /* A standard fstab(5) file */
96 IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */
97 IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */
98 IP__IP4_IFADDR, /* Copy of ip4.addr with interface/netmask */
99#ifdef INET6
100 IP__IP6_IFADDR, /* Copy of ip6.addr with interface/prefixlen */
101#endif
102 IP__MOUNT_FROM_FSTAB, /* Line from mount.fstab file */
103 IP__OP, /* Placeholder for requested operation */
104 KP_ALLOW_CHFLAGS,
105 KP_ALLOW_MOUNT,
106 KP_ALLOW_RAW_SOCKETS,
107 KP_ALLOW_SET_HOSTNAME,
108 KP_ALLOW_SOCKET_AF,
109 KP_ALLOW_SYSVIPC,
110 KP_ENFORCE_STATFS,
111 KP_HOST_HOSTNAME,
--- 46 unchanged lines hidden (view full) ---
158 char *comline;
159 struct cfparams params;
160 struct cfdepends dep[2];
161 struct cfjails *queue;
162 struct cfparam *intparams[IP_NPARAM];
163 struct cfstring *comstring;
164 struct jailparam *jp;
165 struct timespec timeout;
166 const enum intparam *comparam;
167 unsigned flags;
168 int jid;
169 int seq;
170 int pstatus;
171 int ndeps;
172 int njp;
173 int nprocs;
174};
--- 6 unchanged lines hidden (view full) ---
181
182extern void *emalloc(size_t);
183extern void *erealloc(void *, size_t);
184extern char *estrdup(const char *);
185extern void failed(struct cfjail *j);
186extern void jail_note(const struct cfjail *j, const char *fmt, ...);
187extern void jail_warnx(const struct cfjail *j, const char *fmt, ...);
188
189extern int next_command(struct cfjail *j);
190extern int finish_command(struct cfjail *j);
191extern struct cfjail *next_proc(int nonblock);
192
193extern void load_config(void);
194extern struct cfjail *add_jail(void);
195extern void add_param(struct cfjail *j, const struct cfparam *p,
196 enum intparam ipnum, const char *value);
197extern int bool_param(const struct cfparam *p);
--- 26 unchanged lines hidden ---
2 * Copyright (c) 2010 James Gritton.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 9 unchanged lines hidden (view full) ---
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: projects/jailconf/usr.sbin/jail/jailp.h 223189 2011-06-17 16:18:44Z jamie $
27 */
28
29#include <sys/param.h>
30#include <sys/types.h>
31#include <sys/jail.h>
32#include <sys/queue.h>
33#include <sys/time.h>
34
--- 19 unchanged lines hidden (view full) ---
54#define JF_START 0x0001 /* -c */
55#define JF_SET 0x0002 /* -m */
56#define JF_STOP 0x0004 /* -r */
57#define JF_DEPEND 0x0008 /* Operation required by dependency */
58#define JF_WILD 0x0010 /* Not specified on the command line */
59#define JF_FAILED 0x0020 /* Operation failed */
60#define JF_PARAMS 0x0040 /* Parameters checked and imported */
61#define JF_RDTUN 0x0080 /* Create-only parameter check has been done */
62#define JF_PERSIST 0x0100 /* Jail is temporarily persistent */
63#define JF_TIMEOUT 0x0200 /* A command (or process kill) timed out */
64#define JF_SLEEPQ 0x0400 /* Waiting on a command and/or timeout */
65
66#define JF_OP_MASK (JF_START | JF_SET | JF_STOP)
67#define JF_RESTART (JF_START | JF_STOP)
68#define JF_START_SET (JF_START | JF_SET)
69#define JF_SET_RESTART (JF_SET | JF_STOP)
70#define JF_START_SET_RESTART (JF_START | JF_SET | JF_STOP)
71#define JF_DO_STOP(js) (((js) & (JF_SET | JF_STOP)) == JF_STOP)
72
--- 22 unchanged lines hidden (view full) ---
95 IP_MOUNT_FSTAB, /* A standard fstab(5) file */
96 IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */
97 IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */
98 IP__IP4_IFADDR, /* Copy of ip4.addr with interface/netmask */
99#ifdef INET6
100 IP__IP6_IFADDR, /* Copy of ip6.addr with interface/prefixlen */
101#endif
102 IP__MOUNT_FROM_FSTAB, /* Line from mount.fstab file */
103 IP__OP, /* Placeholder for requested operation */
104 KP_ALLOW_CHFLAGS,
105 KP_ALLOW_MOUNT,
106 KP_ALLOW_RAW_SOCKETS,
107 KP_ALLOW_SET_HOSTNAME,
108 KP_ALLOW_SOCKET_AF,
109 KP_ALLOW_SYSVIPC,
110 KP_ENFORCE_STATFS,
111 KP_HOST_HOSTNAME,
--- 46 unchanged lines hidden (view full) ---
158 char *comline;
159 struct cfparams params;
160 struct cfdepends dep[2];
161 struct cfjails *queue;
162 struct cfparam *intparams[IP_NPARAM];
163 struct cfstring *comstring;
164 struct jailparam *jp;
165 struct timespec timeout;
166 const enum intparam *comparam;
167 unsigned flags;
168 int jid;
169 int seq;
170 int pstatus;
171 int ndeps;
172 int njp;
173 int nprocs;
174};
--- 6 unchanged lines hidden (view full) ---
181
182extern void *emalloc(size_t);
183extern void *erealloc(void *, size_t);
184extern char *estrdup(const char *);
185extern void failed(struct cfjail *j);
186extern void jail_note(const struct cfjail *j, const char *fmt, ...);
187extern void jail_warnx(const struct cfjail *j, const char *fmt, ...);
188
189extern int next_command(struct cfjail *j);
190extern int finish_command(struct cfjail *j);
191extern struct cfjail *next_proc(int nonblock);
192
193extern void load_config(void);
194extern struct cfjail *add_jail(void);
195extern void add_param(struct cfjail *j, const struct cfparam *p,
196 enum intparam ipnum, const char *value);
197extern int bool_param(const struct cfparam *p);
--- 26 unchanged lines hidden ---