From a9153ec3040f54fa52b68e14dafed2aba7b780ae Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 7 Mar 2012 09:52:04 -0600 Subject: Initial import Code is based on FreeBSD 8.2 with USB support from Sebastian Huber and Thomas Doerfler. Initial TCP/IP stack work is from Kevel Kirspel. --- rtems/freebsd/rtems/rtems-bsd-jail.c | 92 ++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 rtems/freebsd/rtems/rtems-bsd-jail.c (limited to 'rtems/freebsd/rtems/rtems-bsd-jail.c') diff --git a/rtems/freebsd/rtems/rtems-bsd-jail.c b/rtems/freebsd/rtems/rtems-bsd-jail.c new file mode 100644 index 00000000..d04efe5b --- /dev/null +++ b/rtems/freebsd/rtems/rtems-bsd-jail.c @@ -0,0 +1,92 @@ +/** + * @file + * + * @ingroup rtems_bsd_rtems + * + * @brief TODO. + */ + +/* + * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#include + +/*#include +#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" + +/* Keep struct prison prison0 and some code in kern_jail_set() readable. */ +#ifdef INET +#ifdef INET6 +#define _PR_IP_SADDRSEL PR_IP4_SADDRSEL|PR_IP6_SADDRSEL +#else +#define _PR_IP_SADDRSEL PR_IP4_SADDRSEL +#endif +#else /* !INET */ +#ifdef INET6 +#define _PR_IP_SADDRSEL PR_IP6_SADDRSEL +#else +#define _PR_IP_SADDRSEL 0 +#endif +#endif + +/* prison0 describes what is "real" about the system. */ +struct prison prison0 = { + .pr_id = 0, + .pr_name = "0", + .pr_ref = 1, + .pr_uref = 1, + .pr_path = "/", + .pr_securelevel = -1, + .pr_childmax = JAIL_MAX, + .pr_hostuuid = DEFAULT_HOSTUUID, + .pr_children = LIST_HEAD_INITIALIZER(prison0.pr_children), +#ifdef VIMAGE + .pr_flags = PR_HOST|PR_VNET|_PR_IP_SADDRSEL, +#else + .pr_flags = PR_HOST|_PR_IP_SADDRSEL, +#endif + .pr_allow = PR_ALLOW_ALL, +}; +MTX_SYSINIT(prison0, &prison0.pr_mtx, "jail mutex", MTX_DEF); + -- cgit v1.2.3