Initial revision
[become] / src / rule.h
1 /* -*-c-*-
2 *
3 * $Id: rule.h,v 1.1 1997/07/21 13:47:45 mdw Exp $
4 *
5 * Managing rule sets
6 *
7 * (c) 1997 EBI
8 */
9
10 /*----- Licencing notice --------------------------------------------------*
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
25 * along with `become'; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29 /*----- Revision history --------------------------------------------------*
30 *
31 * $Log: rule.h,v $
32 * Revision 1.1 1997/07/21 13:47:45 mdw
33 * Initial revision
34 *
35 */
36
37 #ifndef RULE_H
38 #define RULE_H
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /*----- Required headers --------------------------------------------------*/
45
46 #include <sys/types.h>
47 #include <sys/socket.h>
48 #include <netinet/in.h>
49 #include <arpa/inet.h>
50
51 #ifndef BECOME_H
52 # include "become.h"
53 #endif
54
55 #ifndef CLASS_H
56 # include "class.h"
57 #endif
58
59 /*----- Functions provided ------------------------------------------------*/
60
61 /* --- @rule_init@ --- *
62 *
63 * Arguments: ---
64 *
65 * Returns: ---
66 *
67 * Use: Intialises the rule database.
68 */
69
70 extern void rule_init(void);
71
72 /* --- @rule_reinit@ --- *
73 *
74 * Arguments: ---
75 *
76 * Returns: ---
77 *
78 * Use: Reinitialises the rule database.
79 */
80
81 extern void rule_reinit(void);
82
83 /* --- @rule_add@ --- *
84 *
85 * Arguments: @classdef *host@ = class of hosts this rule applies to
86 * @classdef *from@ = class of users allowed to change
87 * @classdef *to@ = class of users allowed to be changed to
88 * @classdef *cmd@ = class of commands allowed
89 *
90 * Returns: ---
91 *
92 * Use: Registers another rule.
93 */
94
95 extern void rule_add(classdef */*host*/, classdef */*from*/,
96 classdef */*to*/, classdef */*cmd*/);
97
98 /* --- @rule_check@ --- *
99 *
100 * Arguments: @request *r@ = pointer to a request block
101 *
102 * Returns: Zero if disallowed, nonzero if allowed.
103 *
104 * Use: Checks a request to see if it's allowed.
105 */
106
107 extern int rule_check(request */*r*/);
108
109 /*----- That's all, folks -------------------------------------------------*/
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 #endif