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