author | Mahlon E. Smith <mahlon@martini.nu> |
Sat, 28 Feb 2009 04:54:46 +0000 | |
branch | mahlon-misc |
changeset 12 | 5fd07a9e7e7b |
parent 11 | ext/bsdjail.h@e908d309e7ec |
permissions | -rw-r--r-- |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
1 |
/* |
12
5fd07a9e7e7b
* Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents:
11
diff
changeset
|
2 |
* jail.h - Header for the ruby jail extension |
11 | 3 |
* |
4 |
* vim: set nosta noet ts=4 sw=4: |
|
5 |
* |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
6 |
* $Id$ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
7 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
8 |
* Authors: |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
9 |
* * Michael Granger <ged@FaerieMUD.org> |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
10 |
* * Mahlon E. Smith <mahlon@martini.nu> |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
11 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
12 |
* Copyright (c) 2008, Michael Granger and Mahlon Smith |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
13 |
* All rights reserved. |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
14 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
15 |
* Redistribution and use in source and binary forms, with or without |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
16 |
* modification, are permitted provided that the following conditions are met: |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
17 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
18 |
* * Redistributions of source code must retain the above copyright notice, |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
19 |
* this list of conditions and the following disclaimer. |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
20 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
21 |
* * Redistributions in binary form must reproduce the above copyright notice, |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
22 |
* this list of conditions and the following disclaimer in the documentation |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
23 |
* and/or other materials provided with the distribution. |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
24 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
25 |
* * Neither the name of the author/s, nor the names of the project's |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
26 |
* contributors may be used to endorse or promote products derived from this |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
27 |
* software without specific prior written permission. |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
28 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
29 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
30 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
31 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
32 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
33 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
34 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
35 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
36 |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
37 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
38 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
39 |
* |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
40 |
*/ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
41 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
42 |
#ifndef _BSDJAIL_H_ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
43 |
#define _BSDJAIL_H_ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
44 |
|
12
5fd07a9e7e7b
* Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents:
11
diff
changeset
|
45 |
#include "ruby.h" |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
46 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
47 |
#include <stdio.h> |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
48 |
#include <sys/param.h> |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
49 |
#include <sys/jail.h> |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
50 |
#include <sys/types.h> |
12
5fd07a9e7e7b
* Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents:
11
diff
changeset
|
51 |
#include <sys/sysctl.h> |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
52 |
#include <unistd.h> |
11 | 53 |
#include <arpa/inet.h> |
54 |
#include <errno.h> |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
55 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
56 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
57 |
/* Debugging functions/macros */ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
58 |
#ifdef HAVE_STDARG_PROTOTYPES |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
59 |
#include <stdarg.h> |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
60 |
#define va_init_list(a,b) va_start(a,b) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
61 |
extern void rbjail_debug(const char *fmt, ...); |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
62 |
#else |
12
5fd07a9e7e7b
* Added jail header dependencies for mkmf Makefile.
Mahlon E. Smith <mahlon@martini.nu>
parents:
11
diff
changeset
|
63 |
#include <stdargs.h> |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
64 |
#define va_init_list(a,b) va_start(a) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
65 |
extern void rbjail_debug(fmt, va_alist); |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
66 |
#endif |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
67 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
68 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
69 |
/* Debugging macro */ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
70 |
#if DEBUG |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
71 |
# define debugMsg(f) rbjail_debug f |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
72 |
#else /* ! DEBUG */ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
73 |
# define debugMsg(f) |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
74 |
#endif /* DEBUG */ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
75 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
76 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
77 |
#endif /* _BSDJAIL_H_ */ |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff
changeset
|
78 |