c4f2d992 |
1 | /* -*-c-*- |
2 | * |
c758e654 |
3 | * $Id: rule.h,v 1.5 1998/01/12 16:46:26 mdw Exp $ |
c4f2d992 |
4 | * |
5 | * Managing rule sets |
6 | * |
c758e654 |
7 | * (c) 1998 EBI |
c4f2d992 |
8 | */ |
9 | |
03f996bd |
10 | /*----- Licensing notice --------------------------------------------------* |
c4f2d992 |
11 | * |
12 | * This file is part of `become' |
13 | * |
14 | * `Become' is free software; you can redistribute it and/or modify |
15 | * it under the terms of the GNU General Public License as published by |
16 | * the Free Software Foundation; either version 2 of the License, or |
17 | * (at your option) any later version. |
18 | * |
19 | * `Become' is distributed in the hope that it will be useful, |
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22 | * GNU General Public License for more details. |
23 | * |
24 | * You should have received a copy of the GNU General Public License |
03f996bd |
25 | * along with `become'; if not, write to the Free Software Foundation, |
26 | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
c4f2d992 |
27 | */ |
28 | |
29 | /*----- Revision history --------------------------------------------------* |
30 | * |
31 | * $Log: rule.h,v $ |
c758e654 |
32 | * Revision 1.5 1998/01/12 16:46:26 mdw |
33 | * Fix copyright date. |
34 | * |
35 | * Revision 1.4 1997/09/17 10:27:17 mdw |
30868bd5 |
36 | * Use rewritten class handler. |
37 | * |
38 | * Revision 1.3 1997/08/20 16:22:49 mdw |
063606f7 |
39 | * Rename `rule_reinit' to `rule_end' for more sensible restart. |
40 | * |
03f996bd |
41 | * Revision 1.2 1997/08/04 10:24:25 mdw |
42 | * Sources placed under CVS control. |
43 | * |
44 | * Revision 1.1 1997/07/21 13:47:45 mdw |
c4f2d992 |
45 | * Initial revision |
46 | * |
47 | */ |
48 | |
49 | #ifndef RULE_H |
50 | #define RULE_H |
51 | |
52 | #ifdef __cplusplus |
53 | extern "C" { |
54 | #endif |
55 | |
56 | /*----- Required headers --------------------------------------------------*/ |
57 | |
58 | #include <sys/types.h> |
59 | #include <sys/socket.h> |
60 | #include <netinet/in.h> |
61 | #include <arpa/inet.h> |
62 | |
63 | #ifndef BECOME_H |
64 | # include "become.h" |
65 | #endif |
66 | |
67 | #ifndef CLASS_H |
68 | # include "class.h" |
69 | #endif |
70 | |
71 | /*----- Functions provided ------------------------------------------------*/ |
72 | |
73 | /* --- @rule_init@ --- * |
74 | * |
75 | * Arguments: --- |
76 | * |
77 | * Returns: --- |
78 | * |
79 | * Use: Intialises the rule database. |
80 | */ |
81 | |
82 | extern void rule_init(void); |
83 | |
063606f7 |
84 | /* --- @rule_end@ --- * |
c4f2d992 |
85 | * |
86 | * Arguments: --- |
87 | * |
88 | * Returns: --- |
89 | * |
063606f7 |
90 | * Use: Empties the rule database. |
c4f2d992 |
91 | */ |
92 | |
063606f7 |
93 | extern void rule_end(void); |
c4f2d992 |
94 | |
95 | /* --- @rule_add@ --- * |
96 | * |
30868bd5 |
97 | * Arguments: @class_node *host@ = class of hosts this rule applies to |
98 | * @class_node *from@ = class of users allowed to change |
99 | * @class_node *to@ = class of users allowed to be changed to |
100 | * @class_node *cmd@ = class of commands allowed |
c4f2d992 |
101 | * |
102 | * Returns: --- |
103 | * |
104 | * Use: Registers another rule. |
105 | */ |
106 | |
30868bd5 |
107 | extern void rule_add(class_node */*host*/, class_node */*from*/, |
108 | class_node */*to*/, class_node */*cmd*/); |
c4f2d992 |
109 | |
110 | /* --- @rule_check@ --- * |
111 | * |
112 | * Arguments: @request *r@ = pointer to a request block |
113 | * |
114 | * Returns: Zero if disallowed, nonzero if allowed. |
115 | * |
116 | * Use: Checks a request to see if it's allowed. |
117 | */ |
118 | |
119 | extern int rule_check(request */*r*/); |
120 | |
03f996bd |
121 | /* --- @rule_dump@ --- * |
122 | * |
123 | * Arguments: --- |
124 | * |
125 | * Returns: --- |
126 | * |
127 | * Use: Dumps a map of the current ruleset to the trace output. |
128 | */ |
129 | |
130 | extern void rule_dump(void); |
131 | |
c4f2d992 |
132 | /*----- That's all, folks -------------------------------------------------*/ |
133 | |
134 | #ifdef __cplusplus |
135 | } |
136 | #endif |
137 | |
138 | #endif |