c4f2d992 |
1 | /* -*-c-*- |
2 | * |
063606f7 |
3 | * $Id: rule.h,v 1.3 1997/08/20 16:22:49 mdw Exp $ |
c4f2d992 |
4 | * |
5 | * Managing rule sets |
6 | * |
7 | * (c) 1997 EBI |
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 $ |
063606f7 |
32 | * Revision 1.3 1997/08/20 16:22:49 mdw |
33 | * Rename `rule_reinit' to `rule_end' for more sensible restart. |
34 | * |
03f996bd |
35 | * Revision 1.2 1997/08/04 10:24:25 mdw |
36 | * Sources placed under CVS control. |
37 | * |
38 | * Revision 1.1 1997/07/21 13:47:45 mdw |
c4f2d992 |
39 | * Initial revision |
40 | * |
41 | */ |
42 | |
43 | #ifndef RULE_H |
44 | #define RULE_H |
45 | |
46 | #ifdef __cplusplus |
47 | extern "C" { |
48 | #endif |
49 | |
50 | /*----- Required headers --------------------------------------------------*/ |
51 | |
52 | #include <sys/types.h> |
53 | #include <sys/socket.h> |
54 | #include <netinet/in.h> |
55 | #include <arpa/inet.h> |
56 | |
57 | #ifndef BECOME_H |
58 | # include "become.h" |
59 | #endif |
60 | |
61 | #ifndef CLASS_H |
62 | # include "class.h" |
63 | #endif |
64 | |
65 | /*----- Functions provided ------------------------------------------------*/ |
66 | |
67 | /* --- @rule_init@ --- * |
68 | * |
69 | * Arguments: --- |
70 | * |
71 | * Returns: --- |
72 | * |
73 | * Use: Intialises the rule database. |
74 | */ |
75 | |
76 | extern void rule_init(void); |
77 | |
063606f7 |
78 | /* --- @rule_end@ --- * |
c4f2d992 |
79 | * |
80 | * Arguments: --- |
81 | * |
82 | * Returns: --- |
83 | * |
063606f7 |
84 | * Use: Empties the rule database. |
c4f2d992 |
85 | */ |
86 | |
063606f7 |
87 | extern void rule_end(void); |
c4f2d992 |
88 | |
89 | /* --- @rule_add@ --- * |
90 | * |
91 | * Arguments: @classdef *host@ = class of hosts this rule applies to |
92 | * @classdef *from@ = class of users allowed to change |
93 | * @classdef *to@ = class of users allowed to be changed to |
94 | * @classdef *cmd@ = class of commands allowed |
95 | * |
96 | * Returns: --- |
97 | * |
98 | * Use: Registers another rule. |
99 | */ |
100 | |
101 | extern void rule_add(classdef */*host*/, classdef */*from*/, |
102 | classdef */*to*/, classdef */*cmd*/); |
103 | |
104 | /* --- @rule_check@ --- * |
105 | * |
106 | * Arguments: @request *r@ = pointer to a request block |
107 | * |
108 | * Returns: Zero if disallowed, nonzero if allowed. |
109 | * |
110 | * Use: Checks a request to see if it's allowed. |
111 | */ |
112 | |
113 | extern int rule_check(request */*r*/); |
114 | |
03f996bd |
115 | /* --- @rule_dump@ --- * |
116 | * |
117 | * Arguments: --- |
118 | * |
119 | * Returns: --- |
120 | * |
121 | * Use: Dumps a map of the current ruleset to the trace output. |
122 | */ |
123 | |
124 | extern void rule_dump(void); |
125 | |
c4f2d992 |
126 | /*----- That's all, folks -------------------------------------------------*/ |
127 | |
128 | #ifdef __cplusplus |
129 | } |
130 | #endif |
131 | |
132 | #endif |